After changing device language gives login_required error
WK-shahnawaz-khan opened this issue · 0 comments
WK-shahnawaz-khan commented
Checklist:
- I am using the latest release
- I searched for existing GitHub issues
- I read the documentation
- I verified the client configuration matches the information in the identity provider (or I am using dynamic client registration)
- I am either using a custom URI scheme or
https
with App Links for client redirect. - I can reproduce the issue in the demo app (optional)
Configuration
- Version: 0.11.1
- Integration: (native(Kotlin))
- Identity provider: (Auth0)
Issue Description
I have successfully logged in with OAuth2 and everything working fine. but as soon as I change device language and when i try to authenticate it gives me AuthorizationException: {"type":1,"code":1008,"error":"login_required"} in android API 33, however same process working fine in API 30 and below
code snippet
val authRequestBuilder = AuthorizationRequest.Builder(
authServiceConfiguration(),
configs.client_ID
ResponseTypeValues.CODE,
Uri.parse(configs.callback_url) // Redirect URI
).setScope("openid profile offline_access")
.setState("12345678")
.setClientId(configs.client_ID)
.setPrompt(AuthorizationRequest.Prompt.NONE)
.setAdditionalParameters(mapOf(Pair("additional_param", "id")))
.build()
authService = AuthorizationService(context)
val authIntent = authService.getAuthorizationRequestIntent(authRequestBuilder)
authResultLauncher.launch(authIntent)
private val authResultLauncher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
val data: Intent? = result.data
data?.let {
val authorizationResponse = AuthorizationResponse.fromIntent(it)
val exception = AuthorizationException.fromIntent(data)
if (result.resultCode == Activity.RESULT_OK) {
if (authorizationResponse != null) {
// business logic
} else {
// exception
}
} else {
// exception
}
} ?: kotlin.run {
// exception
}
}