okta / okta-oidc-android

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

Disable Single Sign-On for the authentication session in Android Okta OIDC SDK #285

Open kirtipopli83 opened 2 years ago

kirtipopli83 commented 2 years ago

I am working with Google Integration using Identity Provider.

Okta SDK is taking the default user that is available & linked in the browser. It is not asking to Sign in with Google account.

After checking a couple of documentation of Okta I found that,

If the OktaOidcConfig has noSSO enabled, the browser will always ask user to login. It will not show you the list of logged google accounts.

By default, the browser will check the last session, if valid, then the browser will automatically login the user, even after calling signOut method.

But in iOS, we can disable Single Sign On :

You can disable SSO capabilities by setting noSSO flag to true for OktaOidcConfig instance.

let configuration = OktaOidcConfig(with: {YourOidcConfiguration}) if #available(iOS 13.0, *) { configuration?.noSSO = true }

What is the way in Android to Disable SSO capabilities in Okta OIDC SDK ?

JayNewstrom commented 2 years ago

Android doesn't have the ability to disable a configuration like that (because we don't have one).

Have you tried using the prompt parameter? https://developer.okta.com/docs/reference/api/oidc/#authorize

prompt=login

Sumit-Yadav-India commented 2 years ago

@JayNewstrom tried below-mentioned code for Linked In but it's not working.

fun payLoad(): AuthenticationPayload = AuthenticationPayload.Builder()
        .setIdp(BuildConfig.PAYLOAD)
        .setIdpScope("r_liteprofile r_emailaddress")
        .addParameter("prompt", Prompt.LOGIN)
        .build()
val client =
                     LoginUtils.getWebAuthClient(requireContext(), LoginStateEvent.LoginLinkedIn)
                 client.registerCallback(this, activity)
                 client.signIn(requireActivity(), LoginUtils.payLoad())

We are also unable to clear the browser session same code was working with Okta SSO but for the Linkedin browser cache not clearing.

JayNewstrom commented 2 years ago

I'm not sure if this is a supported configuration on Android. I created an internal issue for our team to look deeper into it.

OKTA-449307