Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
961 views
in Technique[技术] by (71.8m points)

react native expo standalone app google OAuth2 authentication

I am using expo cli and in my app I want to get Google OAuth login. for this I'm following expo documentation link. google login is working fine in expo client app but in standalone app I'm getting "error 400: redirect_uri_mismatch". I have added redirectUrl in input argument of Google.logInAsync({}) as

Google.logInAsync({androidClientId:"xxxxx",
androidStandaloneAppClientId:"xxxxxxxx",
redirectUrl:"ca.myapp:/oauth2redirect/google"})

app.json is

"android": {
  "package": "ca.myapp",
  "versionCode": 1,
  "config":{
    "googleSignIn":{"certificateHash":"xxxxxx"
 }}}

I have generated hash key by using openssl rand -base64 32 | openssl sha1 -c

(recommended by google for hash key keytool -keystore path-to-debug-or-production-keystore -list -v)

And I opted in google console like, google developer console > OAuth client ID > android

Please let me know what is missing here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...