Skip to main content
Function Signature
A PortalAuth method. Removes the session persisted for this authEnvironmentId, and forgets the grant handleRedirect last exchanged and any two-factor session still waiting to be written, so neither a redirect re-delivered after sign-out nor a repeated verifyTotp can bring back the session that was just cleared. Throws
  • PortalAuthError.sessionStorageFailure(message:): The Keychain delete failed.
Notes
  • Call it on sign-out, alongside portal.clearSession(), and from your onSessionInvalidated listener. Portal.clearSession() invalidates the credential the Portal holds but does not reach PortalAuth’s memory of the last grant it exchanged.
  • It is not a sign-out on its own. It does not affect a Portal that already holds the session (there is no server-side revoke); it prevents a future restoreSession() from returning it. Use portal.clearSession() for the live instance.
  • Waits for an in-flight handleRedirect or verifyTotp to finish persisting before deleting, so a sign-in cannot write a session back after the delete.
  • Keychain items survive app deletion, so calling this on the first launch after install gives a fresh install a clean slate.
  • Available starting from SDK version 8.0.0.
Example Usage
Related Documentation