Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After changing device language gives login_required error #1021

Open
4 of 6 tasks
WK-shahnawaz-khan opened this issue Nov 13, 2023 · 0 comments
Open
4 of 6 tasks

After changing device language gives login_required error #1021

WK-shahnawaz-khan opened this issue Nov 13, 2023 · 0 comments
Labels

Comments

@WK-shahnawaz-khan
Copy link

WK-shahnawaz-khan commented Nov 13, 2023

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
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant