Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"email_verified" value cannot be compared to string 'true', it's retu… #12

Merged
merged 1 commit into from
Aug 30, 2018

Conversation

maysam
Copy link
Contributor

@maysam maysam commented Jul 15, 2018

…rning false, it should be compared against value true

…rning false, it should be compared against value true
@dhh
Copy link
Member

dhh commented Jul 16, 2018

What's typecasting the string to a boolean?

@dhh
Copy link
Member

dhh commented Jul 16, 2018

Looks to me that we just get a json payload back with true as a string. Google's own example does a boolean typecast here: https://developers.google.com/identity/sign-in/web/backend-auth

@maysam
Copy link
Contributor Author

maysam commented Jul 17, 2018

Actually it's working in production, but when I was inspecting in development console the "email_verified" was set to true and not "true"

@georgeclaghorn
Copy link
Contributor

georgeclaghorn commented Aug 30, 2018

The OpenID Connect spec indicates that the email_verified claim should have a boolean value, and I see Google returning a boolean:

..."email"=>"george@basecamp.com", "email_verified"=>true...

I’m not sure how the Java code example @dhh linked to works. GoogleIdToken.Payload.getEmailVerified() is documented as returning a Boolean, and there is no version of Boolean.valueOf() that (a) accepts a Boolean object rather than a string or a boolean primitive and (b) returns a boolean primitive. I suspect the example is wrong.

Thanks, @maysam! Sorry for the delay.

@georgeclaghorn georgeclaghorn merged commit 7cf8228 into basecamp:master Aug 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants