identity-toolkit-go
identity-toolkit-go copied to clipboard
Invalid token... invalid audience
Was able to upload the sample webapp on GAE but when I try to access, I am getting an Invalid error blah blah blah: Invalid audience. I have used the "github.com/ConradIrwin/xsrftoken" instead of "github.com/adg/xsrftoken". I also have updated the oauth2 library because I am getting an invalid string clientID being moved to audience []string. Now, when I test the webapp in browser, I am just looping around the login screen screen. Then, checking the log in GAE, I am getting an invalid token. Is there anyone who has been able to make this toolkit work?
var clientID []string
clientID = append(clientID, fmt.Sprintf("%v", clientIDx))
aelog.Infof(c,"clientID: %v", clientID)
token, err := gitkitClient.ValidateToken(c, ts, clientID) <-- this maps to audience []string which errors our when directly pass the clientID as string only. Not sure if this is the one that causes the invalid token issue or the broken xsrf library?
I could deploy favweekday on GAE. login works without problem. I used "github.com/adg/xsrftoken".
I see... So maybe there is just something wrong with my setup. May I know why the adg/xsrftoken is getting an error like below?
go get github.com/adg/xsrftoken
can't load package: package github.com/adg/xsrftoken: no buildable Go source fil
es in C:\Development\go-path\src\github.com\adg\xsrftoken
When I tested adg/xsrftoken existed, now it gives 404. If I make it work with https://github.com/ConradIrwin/xsrftoken I'll let you know.
Edit: I updated to use ConradIrwin's xsrftoken. It works. I just had to change this line
token, err := gitkitClient.ValidateToken(c, ts, []string{clientID})
maybe something is wrong with your configuration. Maybe check if you use the correct file name?
googleAppCredentialsPath = "xxxxxxxx-xxxxxxxx.json"