Skip to main content
Use this page after installation to configure a working Minecraft sign-in flow in Keycloak. If you have not installed the provider yet, complete the installation guide first. To complete the required fields, you need the Xbox flow, the , and the used for stable account linking. If you supply provider credentials through , those values can replace admin UI defaults.

Required Provider Fields

After adding the Minecraft in Keycloak, configure these fields:
This provider supports only the OAuth client authentication method client_secret_post. Do not switch the provider to Basic or JWT-based client authentication.

Optional Provider Fields

The partner private key supports these formats:
  • Raw PEM content
  • Absolute or relative file paths
  • file: URIs
  • resolved through the Keycloak vault

Partner XSTS Requirement

Stable account linking depends on the Xbox partner . The provider requests a second partner token in addition to the Minecraft token. Your Xbox setup must include a that returns the . If the selected partner token exposes the only inside the encrypted payload, configure Partner XSTS Private Key with the matching private key.

Server-Level Credentials

Instead of storing credentials in the realm database, you can provide them at the Keycloak server level through SPI config:
Equivalent kc.sh flags:
Admin UI values take precedence over the server-level defaults when both are configured.

Vault-Backed Secrets

Client Secret and Partner XSTS Private Key may reference a Keycloak vault entry by using the vault: prefix. Example:
Blank or unresolved vault values are rejected during brokered login.

Managed User Attributes

On successful login, the provider stores or refreshes these on the Keycloak user: When Sync Real Name is enabled, the provider also updates Keycloak firstName and lastName from Microsoft claims when they are present.

Verify Configuration

After you save the provider settings, start a test login and confirm these outcomes:
  • Keycloak redirects to Microsoft and returns to the realm broker endpoint successfully
  • The user resolves to the Minecraft Java username when a Java profile exists
  • Managed attributes refresh on the Keycloak user after a successful login

Identity and Linking Behavior

  • The brokered identity uses the resolved Minecraft Java username or Xbox Gamertag as its external username.
  • Initial user import uses that resolved value as the Keycloak username.
  • Existing users keep receiving refreshed managed attributes on login.
  • Brokered account linking uses the Xbox partner instead of the uhs value because ptx is the stable partner-scoped identifier.

Troubleshooting

Login fails before Xbox or Minecraft resolution

Check these points first:
  • The provider still uses client_secret_post
  • Client ID and Client Secret are present either in the admin UI or via SPI config
  • The Azure app registration has the correct redirect URI

Login fails during partner token processing

Check these points:
  • The points to the correct Xbox partner setup
  • The partner token actually returns the
  • Partner XSTS Private Key is configured when the claim is available only in the encrypted token payload

Login fails for Java accounts without a profile

The account may own Java but not yet have a created Java profile. In that case, the user must complete profile creation in the Minecraft Launcher before Java-based login can succeed.