- Notifications
You must be signed in to change notification settings - Fork 461
Closed
Description
Issue
When using Azure B2C on Android, after loging in browser, it's not redirecting back to application and returning error in browser, while iOS works correctly:
“msauth” links are blocked The webpage at msauth://myapp.com/BASE_64_HASH/?state=_... might be temporarily down or it may have moved permanently to a new web address. ERR_UNKNOWN_URL_SCHEME
We are calling authorize using config:
await authorize({ "additionalParameters":{ "prompt":"login", "userTab":"LogIn" }, "clientId":"MY_CLIENT_ID", "issuer":"https://myapp.com/v2.0", "redirectUrl":"msauth://com.myapp/BASE_64_HASH/", "scopes":[ "openid", "offline_access" ], "serviceConfiguration":{ "authorizationEndpoint":"myapp.com/oauth2/v2.0/authorize", "endSessionEndpoint":"myapp.com/oauth2/v2.0/logout", "tokenEndpoint":"myapp.com/oauth2/v2.0/token" }, "warmAndPrefetchChrome":true })
AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="false" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:screenOrientation="portrait" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <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:host="com.myapp" android:path="/BASE_64_HASH" android:scheme="msauth" /> </intent-filter> </activity> </application> </manifest>
app/build.gradle
android { ... namespace "com.myapp" defaultConfig { ... applicationId "com.myapp" manifestPlaceholders = [ appAuthRedirectScheme: 'msauth://com.myapp/BASE_64_HASH' ] }
Info.plist (iOS works correctly):
<key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>com.myapp</string> <key>CFBundleURLSchemes</key> <array> <string>msauth.com.myapp</string> </array> </dict> </array>
On Azure side we have redirect URI:
iOS: msauth.com.myapp://auth
Android: msauth://com.myapp/BASE_64_HASH
And the BASE_64_HASH we generated with:
keytool -exportcert -alias ALIAS_HERE -keystore keystore_android.keystore | openssl sha1 -binary | openssl base64
Any help with this would be appreciated.
Environment
- Your Identity Provider:
Azure
- Platform that you're experiencing the issue on:
Android
- Are you using Expo?:
No
Metadata
Metadata
Assignees
Labels
No labels