# Enable user identity

## Enable user identity

XpansionChain Passport is an <mark style="color:blue;">Open ID</mark> provider and uses the <mark style="color:blue;">Open ID Connect</mark> protocol for authentication and authorization. Third-party applications, such as games or marketplaces, can integrate Passport into their platforms to authenticate their users and access their wallets.

To learn how to create and configure your OAuth client, please refer to the <mark style="color:blue;">Installation guide.</mark>

### How authentication works[​](https://docs.x.immutable.com/docs/x/passport/enable-user-identity#how-authentication-works) <a href="#how-authentication-works" id="how-authentication-works"></a>

When using Passport as an identity provider, the authentication flow begins within your application. If the user already has an account with Passport, they can sign in to their existing account using the same credentials, which can be shared across multiple apps.

For new users, they will need to sign up for a new account and complete the authentication flow to be authenticated in your application.

The high-level steps for the authentication flow are as follows:

1. The user clicks on "Login with Passport" in your application.
2. The user a window pop-up is opened with Passport's secure login page (auth.XpansionChain.com).
3. The user authenticates based on their preferred login method.
4. The user approves the scopes you requested when registering your app's OAuth client (only once).
5. The user is redirected to the callback URL you defined when registering your app's OAuth client.
6. Your application obtains an id\_token and an access\_token.

If you are using the XpansionChain SDK, all these steps are simplified by the `passport.connectIMX()` function. You can find more information here: <mark style="color:blue;">Integrate Login.</mark>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xpansionchain-1.gitbook.io/xpansionchain/products/passport/enable-user-identity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
