'onActivityResult doesn't call for getting response in AppAuth library
I use AppAuth library(https://github.com/openid/AppAuth-Android) for oauth authorization code flow. I do everything step by step from the Read.me. Now I can see the login page but after login I will be transferred to redirect page and stay there and browser doesn't close and onActivityResult never call. (I use navigation component(single activity) and I put onActivityResult in one of my Fragment) what should I do?
private val loginLauncher = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
Log.d(TAG, "loginLauncher: $result")
if (result.resultCode == RESULT_OK) {
viewModel.endLogin(result.data!!)
}
}
but it's never called and this is my manifest:
<activity
android:name="net.openid.appauth.RedirectUriReceiverActivity"
android:exported="true"
tools:node="replace">
<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="myPackageName"
android:path="/oauth2redirect"
android:scheme="https" />
</intent-filter>
</activity>
what should I set for host,path and scheme ?
Now I need get code from redirectUrl and do authorization and send response to my fragment(I think this library support them but not working for me)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
