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

Blank page instead of login on old Android versions #1098

Open
5 of 6 tasks
VitaSokolova opened this issue Oct 24, 2024 · 0 comments
Open
5 of 6 tasks

Blank page instead of login on old Android versions #1098

VitaSokolova opened this issue Oct 24, 2024 · 0 comments
Labels

Comments

@VitaSokolova
Copy link

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 Android
  • Identity provider: Auth0

Issue Description

On emulators with old Android version (e.g. API 23) I see a blank page instead of a login page. On emulators and devices with modern versions the same code works.

I configure my AuthorizationRequest in ViewModel like this:

    private val authService: AuthorizationService = AuthorizationService(context)
    
    private fun startLoginFlow() {
        val serviceConfig = AuthorizationServiceConfiguration(
            Uri.parse("https://authentik.../authorize/"),
            Uri.parse("https://authentik.../token/"),
            null,
            Uri.parse("https://authentik.../end-session/")
        )
        val authRequest = AuthorizationRequest.Builder(
            serviceConfig,
            ClientID,
            ResponseTypeValues.CODE,
            Uri.parse("myapp://authentik.../auth")
        )
            .setLoginHint(args.email)
            .build()

        val customTabsIntent = CustomTabsIntent.Builder().build()
        val authIntent = authService.getAuthorizationRequestIntent(authRequest, customTabsIntent)
        _navigateTo.trySend(NavigationEvent.Login(authIntent))
    }

And I use launcher for activity result on my UI:

    val loginLauncher =
        rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
            if (result.resultCode == Activity.RESULT_OK) {
                result.data?.let { intent ->
                    val authorizationResponse: AuthorizationResponse =
                        AuthorizationResponse.fromIntent(intent)!!
                    val error = AuthorizationException.fromIntent(intent)

                    viewModel.updateAfterAuthorization(authorizationResponse, error)
                }
            }
        }

    LaunchedEffect(navigation) {
            when (navigation) {
                is LoginViewModel.NavigationEvent.Login -> loginLauncher.launch(it.intent)
                ....
        }
    }

t shows only a blank screen. I don't see any error logs and don't know what can be the problem. I found a StackOverflow thread: suggesting adding prompt but it doesn't make any difference.

Screen.Recording.2024-10-24.at.17.38.11.mov

My emulator configuration:

Properties
avd.ini.displayname              Nexus 5 API 23
avd.ini.encoding                 UTF-8
AvdId                            Nexus_5_API_23
disk.dataPartition.size          2G
fastboot.chosenSnapshotFile      
fastboot.forceChosenSnapshotBoot no
fastboot.forceColdBoot           no
fastboot.forceFastBoot           yes
hw.accelerometer                 yes
hw.arc                           false
hw.audioInput                    yes
hw.battery                       yes
hw.camera.back                   virtualscene
hw.camera.front                  emulated
hw.cpu.ncore                     4
hw.device.hash2                  MD5:041eb4f348dec9fd18091e32004fae73
hw.device.manufacturer           Google
hw.device.name                   Nexus 5
hw.dPad                          no
hw.gps                           yes
hw.gpu.enabled                   yes
hw.gpu.mode                      auto
hw.initialOrientation            portrait
hw.keyboard                      yes
hw.lcd.density                   480
hw.lcd.height                    1920
hw.lcd.width                     1080
hw.mainKeys                      no
hw.ramSize                       1536
hw.sdCard                        yes
hw.sensors.orientation           yes
hw.sensors.proximity             yes
hw.trackBall                     no
image.androidVersion.api         23
image.sysdir.1                   system-images/android-23/google_apis/arm64-v8a/
PlayStore.enabled                false
runtime.network.latency          none
runtime.network.speed            full
showDeviceFrame                  yes
skin.dynamic                     yes
tag.display                      Google APIs
tag.displaynames                 Google APIs
tag.id                           google_apis
tag.ids                          google_apis
vm.heapSize                      128

Can someone help me to figure out what could be wrong?

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