-
Notifications
You must be signed in to change notification settings - Fork 76
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
Google Login i need idToken #159
Comments
You probably need an access token. Which is in the |
I managed to get this (google with this lib) working without any issues. |
@marko-birdbuddy Could you explain more about how you got this to work, I believe I'm having the same problem. Frontend
Backend
The above doesn't work, as OP said, I think you need the "id_token" and there's suppose to be some way of deriving one from the other. More broadly though, is it a good idea to use google.oauth2 with this library, or is there a better solution for backend verification of tokens for most login providers just like reactjs-social-login? I tried asking this question on StackOverflow twice, and both times the moderators blocked it because that would invite an "opinionated response". sigh |
Okay, I looked at the source code and saw that you can explicitly set a "typeResponse" to equal "idToken" where the default would otherwise be "accessToken". So this:
...works fine - where data has the field "credential" instead of "access_token" - just like with @react-oauth/google. |
Is this solution still working? I am receiving below error when trying to display login popup, using OP example.
After removing |
Describe the bug
From Google Login i need idToken but not able to get how can i get that?
<LoginSocialGoogle
client_id="373861975505-853d8bvtichuiltu546rhsrrjlq3al15.apps.googleusercontent.com"
typeResponse="idToken"
scope="openid profile email"
ux_mode="popup"
onResolve={({ provider, data }) => {
const login = 'Google';
auth.login({ provider, data, login }, () => {});
}}
onReject={err => {
// eslint-disable-next-line no-console
console.log(err);
}}
>
<Button
variant="contained"
startIcon={}
className="mb-2 socialBTN"
id="Google"
>
Login with Google
The text was updated successfully, but these errors were encountered: