Required Provider Fields
After adding theMinecraft in Keycloak, configure these fields:
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, configurePartner 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:kc.sh flags:
Vault-Backed Secrets
Client Secret and Partner XSTS Private Key may reference a Keycloak vault entry by using the vault: prefix.
Example:
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
uhsvalue becauseptxis 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 IDandClient Secretare 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 Keyis configured when the claim is available only in the encrypted token payload
