okta / samples-android

samples-android
https://github.com/okta/samples-android
Apache License 2.0
37 stars 52 forks source link

Login with Biometric if user logout from app. #102

Open rajeshjadidminc opened 1 year ago

rajeshjadidminc commented 1 year ago

Describe the feature request?

-Enable the biometric for application -Logout the application -If the user has enabled the biometric in the last session then it should be login with biometric instead username and password.

New or Affected Resource(s)

We want to achieve the same behavior like banking applications.as

Provide a documentation link

No response

Additional Information?

No response

rajeshjadidminc commented 1 year ago

@rajdeepnanua-okta What about this feature? any way to implement this?

rajdeepnanua-okta commented 1 year ago

In this case, you don't want to call CredentialBootstrap.oidcClient.createWebAuthenticationClient().logoutOfBrowser, which is being called by UserDashboardViewModel.logoutOfBrowser. Instead, set _loginState to UserDashboardLoginState.LoggedOut in UserDashboardViewModel.logoutOfBrowser.

This should redirect you back to LoginFragment, which currently redirects to UserDashboardFragment if CredentialBootstrap.defaultCredential().idToken() is not null. You can change that to store login state in another class, and emit a LoggedIn value only once the user clicks Login and performs a valid biometric authentication.

rajeshjadidminc commented 1 year ago

Thanks, for the replay on this.

One more quick question is:

If we change the password/lock out account from browser and what and how we can take action on mobile app?

rajdeepnanua-okta commented 1 year ago

In this case, the next call to the backend should fail if the token is no longer valid. Then, the app needs to go back to the login screen since the user isn't logged in any longer.