New google account +

I was able to link my account to my site using Google+ Api,

I have a problem:

  • When a user associates his new account (using an unsigned Google+ social network) in my created api application
  • The user is set up to create a Google+ profile profile.
  • When the submit button was clicked, it was directed to the URL, after which it no longer loads, leaving the screen blank, not knowing if a user account was created on Google +.

Question : is there a way to add or define code in the code if the user has not created an account in Google +?

Another problem is when this account is associated with it, it is registered in the browser, but an error message is displayed "Failed to upgrade the authorization code"

When I debug my code, it has an error in thread authentication:

try:
    # Upgrade the authorization code into a credentials object
    oauth_flow = flow_from_clientsecrets(os.getcwd()+path+'client_secrets.json', scope='')
    oauth_flow.redirect_uri = 'postmessage'
    credentials = oauth_flow.step2_exchange(code)
except FlowExchangeError:
    return 'Failed to upgrade the authorization code.'

Here are the parameters passed in my view:

<meta name="google-signin-scope" content="https://www.googleapis.com/auth/plus.login" />
<meta name="google-signin-requestvisibleactions" content="http://schemas.google.com/AddActivity" />
<meta name="google-signin-cookiepolicy" content="single_host_origin" />

Is the problem related to the parameters? What could be the problem?

The problem is with this issue. Trouble updating Google+ through OAuth2 and multiple sign-in

client_secrets.json:

{ "web":
  { "client_id": "1314.....googleusercontent.com",
    "client_secret": "Se8....",
    "client_email": "1314...@developer.gserviceaccount.com",
    "redirect_uris": [ "postmessage"],
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token"
  }
}

I hope for your help. Thank.

+4
source share

Source: https://habr.com/ru/post/1531515/


All Articles