Please provide the following:
- SDK Version: 37
- Platforms(Android/iOS/web/all): Android (Expo Client)
I’m using useAuthRequest
from expo-auth-session
to fetch an authentication code for itsme, a Belgian OpenID Connect authentication provider.
The code looks like this:
export default function SignUpScreen() {
const discovery = useAutoDiscovery('https://e2emerchant.itsme.be/oidc');
const [request, response, promptAsync] = useAuthRequest(
{
clientId: Itsme.CLIENT_ID,
redirectUri: makeRedirectUri(),
scopes: [
'openid',
'service:CURVO_TEST_SHAREDATA',
'profile',
'email',
'phone',
'address'
],
extraParams: {
claims: JSON.stringify({
userinfo: {
'tag:sixdots.be,2016-06:claim_nationality': null,
'tag:sixdots.be,2016-06:claim_city_of_birth': null,
'tag:sixdots.be,2016-06:claim_eid': null,
'tag:sixdots.be,2017-05:claim_photo': null
}
})
}
},
discovery
);
return (
<TouchableOpacity onPress={promptAsync}>Log in</TouchableOpacity>
);
When the “Log in” button is pressed, the following happens:
- (OK) The itsme application is correctly opened. I can tell that the scopes have also been correctly communicated.
- (OK) I can authenticate within the itsme application with my itsme PIN code.
- (OK) The itsme application then closes, which is expected.
- (OK) My app is re-opened.
- (NOT OK) The
response
variable becomes equal to{ type: 'dismiss' }
.
Whatever I do, the response is always “dismiss”. I find it strange because the docs say:
If the authentication is dismissed manually with
AuthSession.dismiss()
, the result is{ type: 'dismiss' }
.
However, I never call AuthSession.dismiss()
.
It looks like it’s failing right at the last step, when it’s supposed to parse the authorization code out of the response URL.
I tried several things:
- starting Expo in all three modes: tunnel, lan, localhost
- adding a path to the redirect URI, like
makeRedirectUri({ path: '/itsme' })
- the
AppState.currentState
“trick” described in a (related?) GitHub issue.
None of these tries worked and I’m out of ideas. Any thoughts or suggestions? Or maybe how to debug inside expo-auth-session
to see what’s going on?
Thank you in advance.