google-identity

Google Authentication with a Backend Server required Scopes

偶尔善良 提交于 2019-12-03 14:42:05
I am following these instructions ( https://developers.google.com/identity/sign-in/android/backend-auth ) for getting an ID token to be sent to my Backend but when I set String scopes = "audience:server:client_id:" + Service.SERVER_CLIENT_ID; (Yes the SERVER_CLIENT_ID is not the Android Client ID) I fail to get a token and throws this error. E/Login: com.google.android.gms.auth.GoogleAuthException: Unknown However when I use the following scope instead String scopes = "oauth2:profile email"; I successfully get 'a' token but it's not as long as I expected it to be and I'm afraid it might be

Google YOLO stop working : The client origin is not permitted to use this API

风格不统一 提交于 2019-12-03 08:56:25
问题 I assume it has something to do with this: For me Google one Tap stopped working on all my sites that previously worked. I added API HTTP refer to restriction in console.developer.com, but I still get a warning message "The client origin is not permitted to use this API." any thoughts? If you go to the page https://www.wego.com/ you can see that Google one tap still works... https://news.ycombinator.com/item?id=17044518#17045809 but Google YOLO stop working for everyone. I use it like many

Google Sign In API: isSignedIn.get() returning inconsistent values

…衆ロ難τιáo~ 提交于 2019-12-01 17:22:18
I'm trying to check if a user is signed in or not, but I'm getting really inconsistent results that seem to have some sort of race condition involved. I basically took the code Google Developer Website : gapi.load('auth2', function() { auth2 = gapi.auth2.init({ client_id: 'my_client_id.apps.googleusercontent.com', }); console.log(auth2.isSignedIn.get()); setTimeout(function(){console.log(auth2.isSignedIn.get())},50); setTimeout(function(){console.log(auth2.isSignedIn.get())},500); setTimeout(function(){console.log(auth2.isSignedIn.get())},1000); }); For some reason, the first two return false,

How to refresh expired google sign-in logins?

瘦欲@ 提交于 2019-11-28 04:41:38
I'm using Google Sign-In. A user comes to my site and logs in with gapi.auth2.getAuthInstance().signIn() , or they are already logged in and when the page loads (or reloads) we fetch the status. At this point I have an identity token good for an hour that I can validate on the server. When a user leaves the browser sitting (say, overnight), this token expires. gapi.auth2.getAuthInstance().isSignedIn.get() returns true, but the token does not validate. How can I log in a user and keep them logged in while their session is active (ie, browser hasn't been closed)? Or refresh the token? Anything

Error 12501 authenticating with google sign-in

这一生的挚爱 提交于 2019-11-27 01:55:17
I'm using google sign-in services to authenticate users that use my app. I got it to work when I just requested email information GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail().build(); Then, I figured out I also need to request ID token to be able to authenticate with my backend so I did: GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(String.valueOf(R.string.server_client_id)) .requestEmail().build(); The problem is that it wouldn't let me log in after the changes.

How to refresh expired google sign-in logins?

こ雲淡風輕ζ 提交于 2019-11-26 19:24:01
问题 I'm using Google Sign-In. A user comes to my site and logs in with gapi.auth2.getAuthInstance().signIn() , or they are already logged in and when the page loads (or reloads) we fetch the status. At this point I have an identity token good for an hour that I can validate on the server. When a user leaves the browser sitting (say, overnight), this token expires. gapi.auth2.getAuthInstance().isSignedIn.get() returns true, but the token does not validate. How can I log in a user and keep them

Error 12501 authenticating with google sign-in

大兔子大兔子 提交于 2019-11-26 09:49:20
问题 I\'m using google sign-in services to authenticate users that use my app. I got it to work when I just requested email information GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail().build(); Then, I figured out I also need to request ID token to be able to authenticate with my backend so I did: GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(String.valueOf(R.string.server

Occured an INTERNAL_ERROR when requestEmail from GoogleSignInOptions Android

拜拜、爱过 提交于 2019-11-26 08:37:04
问题 I\'m following google instruction to add sign in with google button to my app. If I request sign in without requestEmail() GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .build(); It returns the result as successful. But if I request email, it occures an INTERNAL_ERROR as the status. GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); returns E/Result: Status{statusCode

New Google sign in Android

*爱你&永不变心* 提交于 2019-11-26 03:09:23
问题 I\'m trying to get a user token ID using the new Google play services 8.3 and as documented I pass the server ID: GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.server_client_id)) .requestEmail() .build(); but I\'m still getting un successful result as below: {statusCode=unknown status code: 12501, resolution=null} and documented here GoogleSignInStatusCodes The sign-in was cancelled by the user. i.e. the user