Google example doesn't work · Issue #340 · openid/AppAuth-Android · GitHub
Skip to content

Google example doesn't work #340

Description

@vladikoff

@iainmcgin I tried it several times, am I missing something?

Here's my diff to the example app:

diff --git a/app/AndroidManifest.xml b/app/AndroidManifest.xml
index ef6cbb5..51e6e2a 100644
--- a/app/AndroidManifest.xml
+++ b/app/AndroidManifest.xml
@@ -68,7 +68,7 @@
                 <category android:name="android.intent.category.DEFAULT"/>
                 <category android:name="android.intent.category.BROWSABLE"/>
                 <data android:scheme="https"
-                  android:host="appauth.demo-app.io"
+                  android:host="com.googleusercontent.apps.635748292476-bvqbhssrf1h4ile9m875o2dm2j2rdgog"
                   android:path="/oauth2redirect"/>
             </intent-filter>
         </activity>
diff --git a/app/build.gradle b/app/build.gradle
index 2075e73..0cb2457 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -12,7 +12,7 @@ android {
         // Make sure this is consistent with the redirect URI used in res/raw/auth_config.json,
         // or specify additional redirect URIs in AndroidManifest.xml
         manifestPlaceholders = [
-                'appAuthRedirectScheme': 'net.openid.appauthdemo'
+                'appAuthRedirectScheme': 'com.googleusercontent.apps.635748292476-bvqbhssrf1h4ile9m875o2dm2j2rdgog'
         ]
     }
 
diff --git a/app/res/raw/auth_config.json b/app/res/raw/auth_config.json
index 6f39e24..c81471f 100644
--- a/app/res/raw/auth_config.json
+++ b/app/res/raw/auth_config.json
@@ -1,11 +1,8 @@
 {
-  "client_id": "",
-  "redirect_uri": "net.openid.appauthdemo:/oauth2redirect",
+  "client_id": "635748292476-bvqbhssrf1h4ile9m875o2dm2j2rdgog.apps.googleusercontent.com",
+  "redirect_uri": "com.googleusercontent.apps.635748292476-bvqbhssrf1h4ile9m875o2dm2j2rdgog:/oauth2redirect",
   "authorization_scope": "openid email profile",
-  "discovery_uri": "",
-  "authorization_endpoint_uri": "",
-  "token_endpoint_uri": "",
-  "registration_endpoint_uri": "",
-  "user_info_endpoint_uri": "",
-  "https_required": true
+  "discovery_uri": "https://accounts.google.com/.well-known/openid-configuration"
 }

I generated the client id from https://console.developers.google.com/apis/credentials

I keep getting redirect_uri is not handled by any activity in this app!

One strange thing I see is that I have to modify the manifest.xml value, it doesn't get updated automatically? Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions