Clear User Session on iOS

Is there a way to forcefully log out the user in Okta using OktaAuthSdk in iOS? What is the recommended way to end a user session mobile side?

Is this also an OIDC application, or are you just creating an Okta session with the auth SDK?

If this is an OIDC application, our OIDC SDK’s signOutOfOkta method uses the /logout endpoint to remove the user’s session from their browser.

Actually, the session is created with OktaAuthSdk authenticate method. Not using OIDC.

OktaAuthSdk.authenticate(with: <#T##URL#>, username: <#T##String#>, password: <#T##String?#>, onStatusChange: <#T##(OktaAuthStatus) -> Void#>, onError: <#T##(OktaError) -> Void#>)

@chrishan If you are using OktaAuthSDK, did you try to use the method closeSession()?
You can refer the doc herehttps://github.com/okta/okta-auth-js#closesession .

1 Like