Logout with Passport
Learn how to log users out of Immutable Passport in your Unreal game.
Overview
Passport provides two logout options to accommodate different user experience requirements:
- Hard Logout - Clears sessions from both the SDK and browser
- Soft Logout - Only clears the local SDK session
Logout Implementation
To initiate the logout process in Passport, utilise the Logout node demonstrated below. Two logout options are available:
- Hard Logout: This option clears sessions from both the SDK (local) and the browser used for login. The SDK will open a browser to clear the browser session during the logout process.
- Note, after the browser session has been cleared, the browser will redirect back to the
Logout Uri
configured in theInitialize Passport
Blueprint node. If theLogout Uri
is not set, Passport will use the logout URI configured in the Immutable Hub client settings. - When performing a hard logout on Windows, it's recommended to have a dedicated logout page to redirect users to.
- See the Passport Logout docs for more info.
- Note, after the browser session has been cleared, the browser will redirect back to the
- Soft Logout: If there is a desire to bypass opening the browser during the logout process, set the
DoHardLogout
parameter tofalse
. This will perform only a local logout, and gamers will remain logged in to Passport in the browser until the session expires.- If a user attempts to log back in before the session in the browser expires, they will be automatically logged back in with the session stored in the browser. Please use the hard logout method above if you want the next login to go through the complete login flow.
Logout Types Explained
Hard Logout (Recommended)
💡Hard Logout
This option clears sessions from both the SDK (local) and the browser used for login. The SDK will open a browser to clear the browser session during the logout process.
Important Notes:
- After the browser session has been cleared, the browser will redirect back to the
Logout Uri
configured in theInitialise Passport
Blueprint node - If the
Logout Uri
is not set, Passport will use the logout URI configured in the Immutable Hub client settings - When performing a hard logout on Windows, it's recommended to have a dedicated logout page to redirect users to
- See the Passport Logout docs for more information
Soft Logout
💡Soft Logout
If you want to bypass opening the browser during the logout process, set the
DoHardLogout
parameter to false
. This will perform only a local logout, and gamers will remain logged in to Passport in the browser until the session expires.Considerations:
- If a user attempts to log back in before the session in the browser expires, they will be automatically logged back in with the session stored in the browser
- Use the hard logout method if you want the next login to go through the complete login flow
Next Steps
After logout, users will need to go through the login process again to access Passport features.