Skip to content

Commit

Permalink
updated google.md doc for solving #581 (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
faizplus authored May 10, 2024
1 parent 840d8d7 commit 22683e5
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/config-examples/google.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
Full support out of the box.

```js
const GOOGLE_OAUTH_APP_GUID = 'YOUR_GOOGLE_OAUTH_APP_GUID' // it looks something like 12345678912-k50abcdefghijkabcdefghijkabcdefv
const config = {
issuer: 'https://accounts.google.com',
clientId: 'GOOGLE_OAUTH_APP_GUID.apps.googleusercontent.com',
redirectUrl: 'com.googleusercontent.apps.GOOGLE_OAUTH_APP_GUID:/oauth2redirect/google',
clientId: `${GOOGLE_OAUTH_APP_GUID}.apps.googleusercontent.com`,
redirectUrl: `com.googleusercontent.apps.${GOOGLE_OAUTH_APP_GUID}:/oauth2redirect/google`,
scopes: ['openid', 'profile']
};

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


### Note for Android
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`:
```
android {
defaultConfig {
manifestPlaceholders = [
appAuthRedirectScheme: 'com.googleusercontent.apps.YOUR_GOOGLE_OAUTH_APP_GUID'
// your url will look like com.googleusercontent.apps.12345678912-k50abcdefghijkabcdefghijkabcdefv
]
}
}
```
- You need to check custom URI scheme under APIs & Services -> Credentials -> OAuth 2.0 Client IDs -> Your Client Name -> Advanced Settings
- It may take 5 minutes to a few hours for settings to take effect.

0 comments on commit 22683e5

Please sign in to comment.