AppAuth-Android icon indicating copy to clipboard operation
AppAuth-Android copied to clipboard

Discovery document error

Open DJSendi opened this issue 2 years ago • 3 comments

I´m trying to run my AppAuth Android in my Gluu Server 4.3 installed on my Ubuntu 20, but my app shows a "Failed to retrieve discovery document: Network error.

The only changes i do are in the manifest and the json conf

The manifest changes: <activity android:name="net.openid.appauth.RedirectUriReceiverActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="https" android:host="appopenid.org" android:path="/oauth2redirect"/> </intent-filter> </activity>

The auth_config.json:

{ "client_id": "c23cdb4c-6539-4045-90db-71171d594ffe", "redirect_uri": "https://appopenid.org/oauth2redirect", "end_session_redirect_uri": "https://appopenid.org/oauth2redirect", "authorization_scope": "openid email profile", "discovery_uri": "https://test7.gluu.org/.well-known/openid-configuration", "authorization_endpoint_uri": "", "token_endpoint_uri": "", "registration_endpoint_uri": "", "user_info_endpoint_uri": "", "https_required": true }

The log error says : Network error when retrieving discovery document

I search and it could be cause my IdP isn´t trusted but i don´t know how to solve it

DJSendi avatar Jun 03 '22 09:06 DJSendi

I´m trying to run my AppAuth Android in my Gluu Server 4.3 installed on my Ubuntu 20, but my app shows a "Failed to retrieve discovery document: Network error.

The only changes i do are in the manifest and the json conf

The manifest changes: <activity android:name="net.openid.appauth.RedirectUriReceiverActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="https" android:host="appopenid.org" android:path="/oauth2redirect"/> </intent-filter> </activity>

The auth_config.json:

{ "client_id": "c23cdb4c-6539-4045-90db-71171d594ffe", "redirect_uri": "https://appopenid.org/oauth2redirect", "end_session_redirect_uri": "https://appopenid.org/oauth2redirect", "authorization_scope": "openid email profile", "discovery_uri": "https://test7.gluu.org/.well-known/openid-configuration", "authorization_endpoint_uri": "", "token_endpoint_uri": "", "registration_endpoint_uri": "", "user_info_endpoint_uri": "", "https_required": true }

The log error says : Network error when retrieving discovery document

I search and it could be cause my IdP isn´t trusted but i don´t know how to solve it

Bidestigul avatar Jun 05 '22 06:06 Bidestigul

Per your discoveryUri your server should be running at test7.gluu.org Please fix that information and try again.

agologan avatar Jun 07 '22 18:06 agologan

Hey, I have found the same issue for me it is failing to fetch configurations. I see it logcat "Discovery document error".

When I try to debug it I found that it is failing in AuthorizationServiceConfiguration.ConfigurationRetrievalAsyncTask.doInBackground() on line 383 when it tries to use HttpURLConnection to fetch configurations.

The url is https://****/.well-known/openid-configuration. It fails there with java.net.UnknownHostException: Invalid Hostname for Server

Any idea or progress on this issue?

olehunderdog avatar Nov 21 '22 14:11 olehunderdog