openid / AppAuth-Android

Android client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
https://openid.github.io/AppAuth-Android
Apache License 2.0
2.82k stars 881 forks source link

Discovery document error #834

Open DJSendi opened 2 years ago

DJSendi commented 2 years ago

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">

    </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 commented 2 years ago

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">

    </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

agologan commented 2 years ago

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

olehunderdog commented 1 year ago

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?