Login with Passport
Learn how to authenticate gamers with Immutable Passport in your Unreal game.
The gamer will not have a wallet until the provider and wallet initialisation functions are called. This method retrieves user profile information only.
Identity-only Login​
Embedded Login UI​
The Embedded Login uses a pre-built UI that runs inside your game's Web Browser widget for the identity-only login flow.
- Blueprint
- C++
- Image
UImmutableJSConnectorBrowserWidget* BrowserWidget = ...;
if (UImtblEmbeddedLoginAsyncAction* LoginAsyncAction = UImtblEmbeddedLoginAsyncAction::Login(/* WorldContextObject */ this, BrowserWidget))
{
LoginAsyncAction->Activate();
}

Customising the login prompt​
For a more streamlined user experience, the standard Passport login prompt can be bypassed by providing the DirectLoginOptions parameter to the Login() method. This allows you to streamline the user experience by rendering a customised authentication prompt within your own application.
Once an authentication option (email, Google, Apple, or Facebook) is passed to the Login() method, a popup will be opened so that the user can authenticate securely.
The DirectLoginOptions parameter accepts an FImmutableDirectLoginOptions struct with the following properties:
DirectLoginMethod: The authentication provider (Email,Google,Apple, orFacebook)Email: Required whenDirectLoginMethodisEmail, specifies the user's email addressMarketingConsentStatus: Marketing consent setting (Opted_InorUnsubscribed)
// Customised login with email
FImmutableDirectLoginOptions EmailOptions;
EmailOptions.DirectLoginMethod = EImmutableDirectLoginMethod::Email;
EmailOptions.Email = TEXT("user@example.com");
EmailOptions.MarketingConsentStatus = EImmutableMarketingConsentStatus::Opted_In;
UImtblConnectionAsyncActions::Login(/* WorldContextObject */ this, EmailOptions);
// Customised login with specific provider
UImtblConnectionAsyncActions::Login(/* WorldContextObject */ this, {EImmutableDirectLoginMethod::Google}); // or Apple, Facebook
This approach offers a more streamlined user experience, particularly for games or applications that want to feature individual authentication options in their UI, and has been shown to lead to faster user onboarding and improved conversion rates.
Alternatively, you can use the basic Login() method without any parameters to show the standard Passport login prompt:
UImtblConnectionAsyncActions::Login(/* WorldContextObject */ this);
This will open an external browser window on desktop or an in-app browser on mobile devices, prompting the user to select an authentication option and complete the authentication process securely.
Stored Credentials​
Once the gamer is connected to Passport, the SDK will store your credentials (access, ID, and refresh tokens).
You can use the HasStoredCredentials async action to check if the gamer has stored credentials before deciding whether to show login options in your UI.
HasStoredCredentials blueprint node. However, this async action is currently only Blueprint-compatible because while you can call the static function from C++, the result delegates (OnTrue and OnFalse) are private members, making it impossible to bind callbacks to receive the results. Blueprints work because the Blueprint system automatically handles delegate binding through the visual node interface, but C++ requires direct access to these delegates which the current design doesn't provide.