Skip to content

Commit 22683e5

Browse files
authored
updated google.md doc for solving #581 (#970)
1 parent 840d8d7 commit 22683e5

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/config-examples/google.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
Full support out of the box.
44

55
```js
6+
const GOOGLE_OAUTH_APP_GUID = 'YOUR_GOOGLE_OAUTH_APP_GUID' // it looks something like 12345678912-k50abcdefghijkabcdefghijkabcdefv
67
const config = {
78
issuer: 'https://accounts.google.com',
8-
clientId: 'GOOGLE_OAUTH_APP_GUID.apps.googleusercontent.com',
9-
redirectUrl: 'com.googleusercontent.apps.GOOGLE_OAUTH_APP_GUID:/oauth2redirect/google',
9+
clientId: `${GOOGLE_OAUTH_APP_GUID}.apps.googleusercontent.com`,
10+
redirectUrl: `com.googleusercontent.apps.${GOOGLE_OAUTH_APP_GUID}:/oauth2redirect/google`,
1011
scopes: ['openid', 'profile']
1112
};
1213

@@ -26,5 +27,16 @@ await revoke(config, {
2627

2728

2829
### Note for Android
30+
To [capture the authorization redirect](https://github.com/openid/AppAuth-android#capturing-the-authorization-redirect), add the following property to the defaultConfig in `android/app/build.gradle`:
31+
```
32+
android {
33+
defaultConfig {
34+
manifestPlaceholders = [
35+
appAuthRedirectScheme: 'com.googleusercontent.apps.YOUR_GOOGLE_OAUTH_APP_GUID'
36+
// your url will look like com.googleusercontent.apps.12345678912-k50abcdefghijkabcdefghijkabcdefv
37+
]
38+
}
39+
}
40+
```
2941
- You need to check custom URI scheme under APIs & Services -> Credentials -> OAuth 2.0 Client IDs -> Your Client Name -> Advanced Settings
3042
- It may take 5 minutes to a few hours for settings to take effect.

0 commit comments

Comments
 (0)