Skip to main content

OAuth 2.1 Integration

Secure user-authorized access to RoleDream using OAuth 2.1 with PKCE

OAuth 2.1PKCE RequiredRFC 8414Dynamic Registration
Overview

What is OAuth?

OAuth 2.1 is the industry-standard protocol for authorization. It enables third-party applications to access RoleDream on behalf of users without requiring their passwords. This is primarily used by MCP (Model Context Protocol) clients and other AI tools to securely access your data.

When to Use OAuth

  • MCP/AI tool integrations
  • Building user-facing applications
  • Third-party integrations
  • Applications that need user consent

When to Use API Keys

  • Server-to-server integrations
  • Automated scripts
  • Internal tooling
  • When no user interaction is needed
How it works

Authorization Flow

RoleDream uses the Authorization Code flow with PKCE (Proof Key for Code Exchange) for enhanced security.

1
Authorization Request Your app redirects user to RoleDream authorization endpoint
2
User ConsentUser reviews and approves the requested permissions
3
Authorization CodeRoleDream redirects back with an authorization code
4
Token ExchangeYour app exchanges the code for access tokens
Endpoints

OAuth Endpoints

GET
Authorization Endpoint
/oauth/authorize
POST
Token Endpoint
/oauth/token
POST
Token Revocation
/oauth/revoke
POST
Token Introspection
/oauth/introspect
POST
Dynamic Client Registration
/oauth/register
Discovery

Discovery Endpoints

These well-known endpoints provide server metadata for automatic client configuration.

Authorization Server Metadata
/.well-known/oauth-authorization-server

OAuth 2.0 server configuration (RFC 8414)

Protected Resource Metadata
/.well-known/oauth-protected-resource

Resource server configuration (RFC 9728)

Scopes

Available Scopes

Request only the scopes your application needs. Users will see these permissions during the consent flow.

read:customers

Read customer data and profiles

write:customers

Create and update customer records

read:jobs

Read jobs, solutions, and solution steps

write:jobs

Create and modify job data

read:interviews

Access interview records

mcp

MCP server access for AI integrations

Security

Security Considerations

OAuth 2.1 requires PKCE (Proof Key for Code Exchange) with S256 code challenge method for all clients.
  • Always use HTTPS for all OAuth endpoints
  • Store tokens securely and never expose them in URLs
  • Use short-lived access tokens and refresh tokens for long-term access
  • Implement token revocation when users log out or revoke access
  • Validate redirect URIs to prevent authorization code interception