Questions tagged [google-signin]

Google Sign-In allows users to sign in to your application with their Google accounts

By adding Google Sign-In, you bring the power of Google to your site or application. When a user is signed in, you get an OAuth token for making API requests on their behalf, which you can use to better understand your user, connect them with their friends, and create a richer and more engaging experience.

You can also add the Google+ Sign-In button to your Android or iOS app.

Minimal implementations


Web

Include the required JS headers

<head>
  <script src="https://apis.google.com/js/client:platform.js?onload=startApp" async defer></script>
  <meta name="google-signin-client_id" content="YOUR_CLIENT_ID"></meta>
</head>

Put a placeholder for containing the button

<body>
  <!-- ... -->
  <div id="gConnect">
    <div id="signin-button"></div>
  </div>
  <!-- ... -->
</body>

Render the button and handle user sign-in

function startApp() {
  gapi.load('auth2', function() {
    gapi.client.load('plus','v1').then(function() {
      gapi.signin2.render('signin-button', {
          scope: 'https://www.googleapis.com/auth/plus.login',
          fetch_basic_profile: false });
      gapi.auth2.init({fetch_basic_profile: false,
          scope:'https://www.googleapis.com/auth/plus.login'}).then(
            function (){
              console.log('init');
              auth2 = gapi.auth2.getAuthInstance();
              auth2.isSignedIn.listen( function() {
                  console.log(auth2.currentUser.get());
                });
              auth2.then(function(resp){
                  console.log(auth2.currentUser.get());
                });
            });
    });
  });
}
4946 questions
607
votes
47 answers

Google OAuth 2 authorization - Error: redirect_uri_mismatch

On the website https://code.google.com/apis/console I have registered my application, set up generated Client ID: and Client Secret to my app and tried to log in with Google. Unfortunately, I got the error message: Error: redirect_uri_mismatch The…
user984621
  • 46,344
  • 73
  • 224
  • 412
264
votes
51 answers

Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

The dialog (Google form) for the credentials is opened successfully, but after I fill my credentials I'm getting this error. I followed the instructions from here. Created a Firebase project, enabled the Google Drive API (that's what I need for now)…
193
votes
25 answers

Use different GoogleService-Info.plist for different build schemes

I am using a build scheme for prod and one for staging (with 2 different bundle identifiers) and I am trying to use a separate GoogleService-Info.plist for each scheme. Is there any way to manually select the plist file to use when initialising GCM…
nwaxgui
  • 1,931
  • 2
  • 10
  • 3
163
votes
40 answers

Google Sign In error 12500

I am trying to integrate Google Sign In into my app. I don't have a back-end server, I am just getting the details of the logged on Google Account to my app. I first tried it by using Google Sign In Example but I got an error (No code changes made…
Aaron
  • 2,591
  • 4
  • 27
  • 45
162
votes
25 answers

com.android.build.transform.api.TransformException

I am trying to integrate Google sign in, in my app, I added these libraries: compile 'com.google.android.gms:play-services-identity:8.1.0' compile 'com.google.android.gms:play-services-plus:8.1.0' Also add this to project build gradle: classpath…
saeed shahini
  • 1,847
  • 2
  • 13
  • 15
123
votes
14 answers

App getting crash when click on GoogleSignIn button

I am using Google Sign-In SDK 4.0.1. When I press googleSignInButton then app will be crash. And gave below error, how to fix this: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Your app is missing support for the…
Vikas
  • 1,548
  • 2
  • 12
  • 25
120
votes
6 answers

How to get list of downloaded apps (paid/free) by a user from Google Play?

I recently came across this app Purchase Apps, which is somehow able to retrieve apps I've paid for in google play after I signed in using my google account. I'm trying to find out how it is being done as I want to build a similar app, but for the…
vepzfe
  • 4,217
  • 5
  • 26
  • 46
106
votes
7 answers

The given origin is not allowed for the given client ID (GSI)

I was refactoring my "Sign in with Google" by replacing gapi with gsi on http://localhost:8080. How can gapi work without problems while gsi claims that The given origin is not allowed for the given client ID. gapi
Crow
  • 4,635
  • 3
  • 14
  • 21
101
votes
11 answers

http:403 forbidden error when trying to load img src with google profile pic

hello everyone I am trying to load google profile picture in my site and other ones I have done var profile = googleUser.getBasicProfile(); profile.getImageUrl() when I sign in with google and save the image url to a database but when I try to put…
JRowan
  • 6,824
  • 8
  • 40
  • 59
97
votes
14 answers

Google sign in not working after publishing in play store

I went through this, and as far as the process goes I did that. But I when I installed the app from play store I am not able to sign in using the google sign in button. I have used Firebase for google sign in. When I am clicking the sign in button…
arqam
  • 3,582
  • 5
  • 34
  • 69
85
votes
16 answers

google signIn not working in release mode apk android

In release mode, my google sign-in is not working, but it works fine in debug mode. I got a similar question from SO here, but I didn't get perfect solutions. My handleSignInResult is coming false - How can this be fixed?
Elizabeth
  • 1,399
  • 1
  • 13
  • 25
81
votes
9 answers

iOS 10 GM release error when submitting apps "app attempts to access privacy-sensitive data without a usage description" due to GoogleSignIn, AdMob

I just started facing this issue with the iOS 10 GM release. I received an email saying: To process your delivery, the following issues must be corrected: This app attempts to access privacy-sensitive data without a usage description. The app's…
73
votes
10 answers

Google: Permission denied to generate login hint for target domain NOT on localhost

I am trying to create a Google sign-in and getting the error: Permission denied to generate login hint for target domain Before you mark this a duplicate, this is not the same as the question asked at Google sign in website Error : Permission…
jimboweb
  • 4,362
  • 3
  • 22
  • 45
67
votes
6 answers

ITMS-90535 Unable to publish iOS app with latest Google Signin SDK

I'm using xcode 7 GM seed and installed latest Google Signin SDK through cocoapods pod "Google/SignIn . I get the attached error when I try to publish my app to apple app store. Help!! Here are the detailed versions of Google SDK pods -…
Guy
  • 2,883
  • 1
  • 32
  • 39
61
votes
5 answers

AWS Cognito: Best practice to handle same user (with same email address) signing in from different identity providers (Google, Facebook)

When signing in a user with the same email address through the Google and Facebook identity providers, AWS Cognito creates multiple entries in the user pool, one entry per identity provider used: I have used the example code provided in this…
1
2 3
99 100