react-native-app-auth: Can't get the result of authorize call
Issue
Hello.
I’m trying to use authorize but can’t get the result of the call. After calling authorize auth window pops up, I fill the credentials, it closes but the code after never gets executed (nor any error caught). I tried debugging OIDAuthorizationService.m in Xcode and it looks like authorization completes successfully with the token.
const config = {
issuer: '***',
clientId: '***',
redirectUrl: 'APP_URI://',
scopes: [***]
}
try {
const result = await authorize(config) // nothing gets executed after
console.log({ result })
} catch (error) {
console.log(error)
}
RN version: 0.69.5
iOS: 14.2
AppDelegate.h is configured.
Info.plist is configured.
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>APP_BUNDLE_ID</string>
<key>CFBundleURLSchemes</key>
<array>
<string>APP_URI</string>
</array>
</dict>
</array>
Environment
- Your Identity Provider:
IdentityServer 4 - Platform that you’re experiencing the issue on:
both - Are you using Expo?:
No
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 16 (1 by maintainers)
I don’t know if this is the case here but I had exactly the described behavior due to a missing “/” at the end of the redirectUrl on iOS.
On Android it also worked without “/” at the end.