Download OpenAPI specification:
OAuth 2.1 Authorization Server for SlideRule. Supports authorization code flow with PKCE (for web clients), device flow (for CLI/Python clients), and PAT-based login. Acts as an intermediary to GitHub OAuth while issuing its own JWTs.
Register a new OAuth client. Returns a client_id that must be used in subsequent authorization requests. Supports PKCE with S256 only.
| redirect_uris required | Array of strings <uri> non-empty [ items <uri > ] Array of allowed redirect URIs. Must be https or http://localhost. |
| client_name | string <= 200 characters Human-readable name for the client. |
| grant_types | Array of strings Default: ["authorization_code"] Items Enum: "authorization_code" "refresh_token" |
| response_types | Array of strings Default: ["code"] Items Value: "code" |
| token_endpoint_auth_method | string Default: "none" Value: "none" Only 'none' is supported (PKCE is used instead of client_secret). |
| code_challenge_method | string Default: "S256" Value: "S256" Only S256 is supported. |
| scope | string Space-separated list of requested scopes. |
{- "client_name": "My MCP Client",
- "grant_types": [
- "authorization_code"
], - "response_types": [
- "code"
], - "token_endpoint_auth_method": "none",
- "code_challenge_method": "S256",
- "scope": "mcp:tools mcp:resources"
}{- "client_id": "5b3fa7ba-57d3-4017-a65b-d57dcd2db643",
- "client_id_issued_at": 0,
- "client_name": "string",
- "grant_types": [
- "string"
], - "response_types": [
- "string"
], - "token_endpoint_auth_method": "string",
- "code_challenge_method": "string",
- "scope": "string"
}Initiates the authorization code flow with PKCE. Validates the client session, stores the code challenge, and redirects the user to GitHub for authentication.
| response_type required | string Value: "code" |
| client_id required | string <uuid> Client ID obtained from registration. |
| redirect_uri required | string <uri> Must match one of the URIs registered during client registration. |
| state required | string Opaque value for CSRF protection, returned unchanged in the callback. |
| scope | string Example: scope=mcp:tools mcp:resources Space-separated list of scopes. Must be subset of registered scopes. |
| code_challenge required | string PKCE code challenge (BASE64URL(SHA256(code_verifier))). |
| code_challenge_method required | string Value: "S256" |
| resource | string <uri> Optional resource indicator (RFC 8707). Must be https and under the service domain. |
{- "error": "internal_error",
- "error_description": "Error processing request"
}Handles the redirect from GitHub after user authorization. Validates the HMAC-signed state parameter (CSRF protection), generates an authorization code, and redirects back to the client's redirect_uri with the code and state.
| code required | string Authorization code from GitHub. |
| state required | string HMAC-signed state parameter for CSRF validation. |
| error | string |
| error_description | string |
{- "error": "internal_error",
- "error_description": "Error processing request"
}Final stage of the OAuth 2.1 authorization code flow. Exchanges the authorization code for a JWT access token. Requires PKCE code_verifier to prove possession of the original code_challenge.
| grant_type required | string Value: "authorization_code" |
| code required | string Authorization code received from the callback. |
| redirect_uri required | string <uri> Must match the redirect_uri used in the authorization request. |
| client_id required | string <uuid> |
| code_verifier required | string PKCE code verifier (original random string). |
{- "access_token": "string",
- "token_type": "Bearer",
- "expires_in": 43200,
- "refresh_token": "string",
- "scope": "mcp:tools mcp:resources",
- "info": {
- "username": "string",
- "isOrgMember": "true",
- "isOrgOwner": "true",
- "org": "string",
- "orgRoles": "string",
- "tokenIssuedAt": "string",
- "tokenExpiresAt": "string",
- "tokenIssuer": "string"
}
}Initiates the OAuth device flow for CLI/Python clients. Returns a device code, user code, and verification URI. The user must visit the verification URI and enter the user code to authorize the device.
{- "device_code": "string",
- "user_code": "ABCD-1234",
- "expires_in": 0,
- "interval": 5
}Client polls this endpoint with the device_code to check if the user has completed authorization. Returns 202 while pending, 200 on success with token and metadata, or 400 on terminal failure.
| device_code required | string The device_code received from the device code request. |
{- "device_code": "string"
}{- "status": "success",
- "token": "string",
- "metadata": {
- "org_roles": [
- "string"
], - "sub": "string",
- "aud": [
- "string"
], - "org": "string",
- "iat": 0,
- "exp": 0,
}
}Authenticate using a GitHub PAT. The PAT is verified against the GitHub API, and if valid, a SlideRule JWT is issued.
| pat required | string GitHub Personal Access Token with read:org scope. |
{- "pat": "string"
}{- "status": "success",
- "token": "string",
- "metadata": {
- "org_roles": [
- "string"
], - "sub": "string",
- "aud": [
- "string"
], - "org": "string",
- "iat": 0,
- "exp": 0,
}
}Simple OAuth 2.0 flow for trusted internal services (HAProxy, Grafana). Redirects to GitHub for authentication and returns a JWT in a cookie. Only trusted redirect hosts are allowed.
| redirect_uri required | string <uri> Must point to a trusted redirect host. |
{- "error": "internal_error",
- "error_description": "Error processing request"
}Returns the OpenID Connect discovery document with issuer, JWKS URI, and supported algorithms.
{- "response_types_supported": [
- "code"
], - "subject_types_supported": [
- "public"
], - "id_token_signing_alg_values_supported": [
- "RS256"
]
}Returns the authorization server metadata document describing endpoints, supported grant types, scopes, and PKCE configuration.
{- "response_types_supported": [
- "code"
], - "scopes_supported": [
- "mcp:tools",
- "mcp:resources",
- "sliderule:access",
- "runner:access",
- "provisioner:access",
- "monitor:access"
], - "token_endpoint_auth_methods_supported": [
- "none"
], - "code_challenge_methods_supported": [
- "S256"
], - "id_token_signing_alg_values_supported": [
- "RS256"
], - "grant_types_supported": [
- "authorization_code",
- "refresh_token"
]
}