okta / samples-android

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

Browser-Sign-In example sign out does not work #60

Closed noinarisak closed 3 years ago

noinarisak commented 3 years ago

Hey @FeiChen-okta,

When I click on the SIGN-OUT button, I'm not redirected to launch/landing page and it seems like the session has not been revoke.

Steps:

  1. Click Browser-Sample app.
  2. Click on SIGN IN and enter credentials
  3. Click on SIGN OUT and close the app.
  4. Click Browser-Sample app.
  5. No authN and Profile screen is presented, but assuming that my session was killed.

Other:

  1. Click Revoke Token and it work as expected. I tired the following code
# UserInfoActivity.java

    private void logOut() {
        getWebAuthClient().signOutOfOkta(this);
//        NOTE: logOut does not work the way you expect, the below did not behave as expected.
//        getSessionClient().clear();
//        navigateToStartActivity();
    }

Screenshot Screen Shot 2021-02-17 at 12 12 58 PM

Notice #7 but it referencing our old SDK.

FeiChen-okta commented 3 years ago

Hi @noinarisak,

The signOutOfOkta starts the browser to clear the session. It then redirects to the application and triggers the result callback n UserInfoActivity. Make the following changes to the success callback and check for the status AuthorizationStatus.SIGNED_OUT then add

getSessionClient().clear();
navigateToStartActivity();
noinarisak commented 3 years ago

Thanks @FeiChen-okta! That did the job. I could submit a PR on the fix that you advised. I would assume other dev would probably want to see the same experience when they click on the SIGN OUT.

FeiChen-okta commented 3 years ago

@noinarisak Glad everything worked out. Sure you can submit a PR.