okta / samples-android

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

Added Fingerprint demo #29

Closed ihormartsekha-okta closed 5 years ago

ihormartsekha-okta commented 5 years ago

Mode to new oidc library Added sample of Rx implementation

FeiChen-okta commented 5 years ago

@ihormartsekha-okta The sample look good. My observation is that the fingerprint sensor and callback is always on and listening. I observed that when trying to sign out it would not work after 10 seconds. But after simulate the fingerprint sensor in the emulator I can sign out without the dialog. Can we make the sample that only initialize and use the fingerprint sensor to authenticate only when it is needed? For example when trying to decrypt data, you should catch a UserNotAuthenticatedException then initialize the fingerprint sensor instead of always listening?

Some issues I see:

  1. Resume app always ask for smart lock:

    • select no for using smart lock after authentication
    • Exit the app.
    • Launch the app. It will ask you again if you want to enable smart lock. We can put a checkbox to indicate smart lock is enabled or not. If they want to enable it they can check it and a dialog will appear.
  2. Whats the difference between SIGN IN and FINGERPRINT SIGN IN? Both looks like are doing the same flow that asks if the user want to enable smart lock after auth completes.

  3. Sign out button doesn't work after 10 seconds. After authentication sign out doesn't do anything after waiting for 10s or more. But sign out works for the first 10s after any operation that requires finger print such as refresh token. Or if you touch the fingerprint sensor to authenticate even without a prompt to do so. This is probably due to the validity period. But this should not happen since the the TokenResponse and all the needed data for sign out should be in cache.

  4. When refreshing a token a toast shows the following error: Screen Shot 2019-05-28 at 2 20 47 PM

Note the above toast error and dialog does not show up when I touch the fingerprint sensor first. Is the toast just for debugging?

  1. After relaunching the app and canceling the smart lock dialog trying to sign in again will show the following screen with the shown toast: Screen Shot 2019-05-28 at 2 24 26 PM

  2. Sometimes when exiting the app and returning. It gets stuck in the following screen: Screen Shot 2019-05-28 at 2 20 11 PM