okta / okta-oidc-android

OIDC SDK for Android
https://github.com/okta/okta-oidc-android
Other
60 stars 45 forks source link

WebClient not opening when running with lifecycle runtime 2.3.0 #228

Closed mchemin closed 3 years ago

mchemin commented 3 years ago

Repro step

  1. Create a project with dependency on "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0"
  2. Call WebAuthClient#singnIn

Expected result The web client open with the correct login page

Actual result Okta SDK fails silently and the login page does not opened.

Suggested explanation We have observed that the call OktaResultFragment fragment = new OktaResultFragment(); in OktaResultFragment is done inside the RequestDispatcher mDispatcher from the WebAuthClientImpl class. The code from the RequestDispatcher shows us that the instantiation of the fragment is done using a background thread executor.

The "androidx.lifecycle:lifecycle-runtime-ktx:2.3.0" now forces fragment to be created on the main thread see the release note

Edit put the correct dependencies

JayNewstrom commented 3 years ago

Hi @mchemin sorry to hear you're having an issue with the SDK.

I tried to reproduce this in one of our internal apps (Adding "androidx.lifecycle:lifecycle-livedata-ktx:2.3.0"), but I wasn't able to recreate the issue. Do you have more information, or a reproduction sample for us to debug?

mchemin commented 3 years ago

I'm sorry it was with androidx.lifecycle:lifecycle-runtime-ktx:2.3.0 I'll try to make a sample before tomorrow.

JayNewstrom commented 3 years ago

Thanks for the update! I'm able to reproduce now.

I've created an internal issue for us to fix this: OKTA-383062

As a temporary workaround, I'd suggest not updating for now.

mchemin commented 3 years ago

Thanks for your quick answer !

NikitaAvraimov-okta commented 3 years ago

@mchemin Fix is merged into master, we will notify once it`s published

EtienneStPierre commented 3 years ago

@mchemin Fix is merged into master, we will notify once it`s published

Hi, I was wondering if you have an ETA for the release of version 1.0.8

Thank you!

NikitaAvraimov-okta commented 3 years ago

@EtienneStPierre Its on our shortlist, we will post an update here when its released

claire-1 commented 3 years ago

Hello, are there any updates on when this fix will be released?

I would like to update to the latest version of react-native-keychain (v 7.0.0), but it adds a dependency on androidx.lifecycle:lifecycle-viewmodel:2.3.1, which breaks the Okta experience on my app for the reasons already described in this thread. It would be great if this could be fixed so I can upgrade.

JayNewstrom commented 3 years ago

I apologize for the delay. This has been released as https://github.com/okta/okta-oidc-android/releases/tag/1.0.19 Please note the change in maven coordinates.