// Identity Federation
Dragon Key is the identity federation layer for the DragonSource ecosystem. Built on OAuth2 / OpenID Connect, it enables partner platforms to validate Dragon credentials and establish trust.
/.well-known/openid-configurationOIDC Discovery document — returns all endpoint URLs, supported scopes, and signing algorithms
/auth/authorizeAuthorization endpoint — initiates the authentication flow. Params: client_id, redirect_uri, response_type=code, scope, state
/auth/tokenToken endpoint — exchanges authorization code for access_token and id_token. Params: grant_type, code, client_id, client_secret
/auth/userinfoUserInfo endpoint — returns claims about the authenticated user. Requires Bearer token in Authorization header
User clicks 'Sign in with Dragon Key' on your app
Your app redirects to https://dragonsource.org/auth/authorize with client_id, redirect_uri, scope
User authenticates with DragonSource credentials
DragonSource redirects back with authorization code
Your server exchanges code for tokens at /auth/token
Use the access token to fetch user info at /auth/userinfo
subUnique identifier for the partner/usernameDisplay name of the partner organizationemailContact email (requires email scope)partner_idDragonSource partner IDtierPartnership tier: community, technology, research, strategicverifiedBoolean — whether the partner holds DragonSource Verified status// 1. Get OIDC Discovery
const discovery = await fetch(
'https://dragonsource.org/.well-known/openid-configuration'
).then(r => r.json());
// 2. Build authorization URL
const authUrl = new URL(discovery.authorization_endpoint);
authUrl.searchParams.set('client_id', YOUR_CLIENT_ID);
authUrl.searchParams.set('redirect_uri', YOUR_REDIRECT_URI);
authUrl.searchParams.set('response_type', 'code');
authUrl.searchParams.set('scope', 'openid profile');
authUrl.searchParams.set('state', generateRandomState());
// 3. Redirect user
window.location.href = authUrl.toString();
// 4. Exchange code for tokens (server-side)
const tokens = await fetch(discovery.token_endpoint, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
grant_type: 'authorization_code',
code: authorizationCode,
client_id: YOUR_CLIENT_ID,
client_secret: YOUR_CLIENT_SECRET,
redirect_uri: YOUR_REDIRECT_URI,
}),
}).then(r => r.json());
// 5. Fetch user info
const userInfo = await fetch(discovery.userinfo_endpoint, {
headers: { Authorization: `Bearer ${tokens.access_token}` },
}).then(r => r.json());
console.log(userInfo);
// { sub: "...", name: "Partner Name", tier: "technology", verified: true }