Skip to content

Manual OIDC Configuration

This guide provides the technical details needed to configure a generic OIDC client or to implement the flow manually.

MC-ID implements OAuth 2.1 with OpenID Connect. This means:

  • PKCE is mandatory - You must include code_challenge and code_challenge_method=S256 in authorization requests
  • Only response_type=code - The implicit flow is not supported
  • State parameter required - For CSRF protection

MC-ID provides standard discovery endpoints for automatic client configuration:

EndpointPathDescription
OpenID Configuration/.well-known/openid-configurationStandard OIDC discovery document.
OAuth Authorization Server/.well-known/oauth-authorization-serverOAuth 2.0 AS metadata (RFC 8414).

Most OIDC libraries can auto-configure using just the issuer URL (https://mc-id.com).

If you are self-hosting MC-ID or configuring a client manually, use the following endpoints. Replace https://mc-id.com with your instance URL if self-hosting.

EndpointPathDescription
Issuerhttps://mc-id.comThe OIDC Issuer URL.
Authorization/api/auth/oauth2/authorizeURL to redirect users to for login.
Token/api/auth/oauth2/tokenURL to exchange code for tokens.
Userinfo/api/auth/oauth2/userinfoURL to fetch user claims.
JWKS/api/auth/oauth2/jwksURL to fetch public signing keys.

MC-ID supports the following scopes:

ScopeRequiredDescription
openidYesRequired for OIDC. Returns the sub claim.
profileYesAccess to MC-ID account details (name, accounts).
emailNoAccess to email address (email, email_verified).
connectionsNoAccess to linked accounts, e.g. Minecraft, Discord (connections).
offline_accessNoEnables refresh tokens for long-lived sessions.

When redirecting users to the authorization endpoint, include these parameters:

ParameterDescription
client_idYour application’s Client ID.
redirect_uriMust exactly match a registered redirect URI.
response_typeMust be code.
scopeSpace-separated list of scopes (must include openid).
stateRandom string for CSRF protection.
code_challengeBase64url-encoded SHA-256 hash of the code verifier.
code_challenge_methodMust be S256 (case-sensitive).

When exchanging the authorization code for tokens:

ParameterDescription
grant_typeMust be authorization_code.
codeThe authorization code from the callback.
redirect_uriMust match the authorization request.
client_idYour application’s Client ID.
client_secretYour application’s Client Secret.
code_verifierThe original random string used to generate the code challenge.

The Userinfo endpoint returns claims based on the scopes you requested.

{
"sub": "AaltJ3XUoyDQiqDVk865CILljZBXrjZz",
"email": "user@example.com",
"name": "Notch",
"email_verified": true,
"accounts": [
{
"uuid": "069a79f444e94726a5befca90e38aaf5",
"primary": true,
"username": "Notch"
}
],
"connections": [
{
"providerId": "discord",
"accountId": "123456789012345678"
}
]
}
ScopeClaims Returned
openidsub
profilename, accounts
emailemail, email_verified
connectionsconnections