Comprehensive guides and references for the OpenFrame platform
The Authorization Server Rest Controllers module exposes the HTTP endpoints that drive authentication, tenant onboarding, invitation acceptance, password reset, and SSO discovery for the OpenFrame multi-tenant Authorization Server.
This module sits at the edge of the Authorization Server service and translates incoming HTTP requests into domain-level operations handled by services in the core authorization modules.
It is part of the Authorization Server application entrypoint:
OpenFrameAuthorizationServerApplication (service-applications-entrypoints)For core authorization configuration, tenant context handling, and security filter chains, see:
The Authorization Server Rest Controllers module is responsible for:
These controllers are thin HTTP adapters and delegate business logic to services in:
authorization-server-sso-and-registration-flowauthorization-server-core-and-tenant-contextauthorization-server-keys-and-persistencedata-mongo-core-and-documentsflowchart TD
Client["Browser or Frontend Client"] --> LoginController["Login Controller"]
Client --> InvitationController["Invitation Registration Controller"]
Client --> PasswordResetController["Password Reset Controller"]
Client --> SsoDiscoveryController["SSO Discovery Controller"]
Client --> TenantDiscoveryController["Tenant Discovery Controller"]
Client --> TenantRegistrationController["Tenant Registration Controller"]
InvitationController --> InvitationService["Invitation Registration Service"]
InvitationController --> SsoInvitationService["SSO Invitation Service"]
PasswordResetController --> PasswordResetService["Password Reset Service"]
SsoDiscoveryController --> SsoConfigService["SSO Config Service"]
SsoDiscoveryController --> InvitationValidator["Invitation Validator"]
TenantDiscoveryController --> TenantDiscoveryService["Tenant Discovery Service"]
TenantRegistrationController --> TenantRegistrationService["Tenant Registration Service"]
TenantRegistrationController --> SsoTenantRegistrationService["SSO Tenant Registration Service"]
Each controller focuses on request validation, HTTP concerns (cookies, redirects, status codes), and delegates domain logic to dedicated services.
Class: InvitationRegistrationController
Base Path: /invitations
POST /invitations/accept
InvitationRegistrationRequest.InvitationRegistrationService.registerByInvitation.AuthUser.GET /invitations/accept/sso
SsoInvitationAcceptRequest via query parameters.SsoInvitationService.startAccept.COOKIE_SSO_INVITE).303 See Other redirect to the OAuth2 authorization endpoint.sequenceDiagram
participant Browser
participant InvitationController as "Invitation Controller"
participant SsoInvitationService as "SSO Invitation Service"
participant OAuth2 as "Spring Security OAuth2"
Browser->>InvitationController: GET /invitations/accept/sso
InvitationController->>SsoInvitationService: startAccept(request)
SsoInvitationService-->>InvitationController: SsoAuthorizeData
InvitationController->>Browser: Set-Cookie sso_invite
InvitationController->>Browser: 303 See Other redirect
Browser->>OAuth2: Redirect to authorization endpoint
Key characteristics:
HttpOnly, Secure, path /).cookieTtlSeconds().Class: LoginController
Paths: /login, /
This is a traditional Spring MVC controller returning server-rendered views:
GET /login
?error parameter is present.openframe.password-reset.page-url).login view.GET /
index view.This controller integrates with Spring Security’s authentication filter chain defined in the Authorization Server configuration.
Class: PasswordResetController
Base Path: /password-reset
POST /password-reset/request
ResetRequest.PasswordResetService.createResetToken.202 Accepted.POST /password-reset/confirm
ResetConfirm.PasswordResetService.resetPassword.204 No Content.sequenceDiagram
participant User
participant PasswordController as "Password Reset Controller"
participant ResetService as "Password Reset Service"
User->>PasswordController: POST /password-reset/request
PasswordController->>ResetService: createResetToken(email)
User->>PasswordController: POST /password-reset/confirm
PasswordController->>ResetService: resetPassword(token, newPassword)
The controller is intentionally minimal and delegates all security-sensitive logic to the service layer.
Class: SsoDiscoveryController
Base Path: /sso/providers
This controller exposes available SSO providers based on context.
GET /sso/providers/invite?invitationId=...
InvitationValidator.AuthInvitation.SSOConfigService.getEffectiveProvidersForTenant.GET /sso/providers/registration
SSOConfigService.getDefaultProviders.Response type:
ProvidersResponse
- providers: List<String>
This enables frontend clients to dynamically render SSO buttons (e.g., Google, Microsoft) depending on tenant or global configuration.
Class: TenantDiscoveryController
Base Path: /tenant
GET /tenant/discover?email=...TenantDiscoveryService.discoverTenantForEmail.TenantDiscoveryResponse.This endpoint powers the multi-tenant login flow, where the system determines:
Class: TenantRegistrationController
Base Path: /oauth
POST /oauth/register
TenantRegistrationRequest.TenantRegistrationService.registerTenant.Tenant.GET /oauth/register/sso
SsoTenantRegistrationInitRequest.SsoTenantRegistrationService.startRegistration.COOKIE_SSO_REG).sequenceDiagram
participant Browser
participant TenantController as "Tenant Registration Controller"
participant SsoRegService as "SSO Tenant Registration Service"
participant OAuth2 as "Spring Security OAuth2"
Browser->>TenantController: GET /oauth/register/sso
TenantController->>SsoRegService: startRegistration(request)
SsoRegService-->>TenantController: SsoAuthorizeData
TenantController->>Browser: Set-Cookie sso_reg
TenantController->>Browser: 303 See Other redirect
Browser->>OAuth2: Authorization request
This mirrors the invitation SSO flow but targets tenant onboarding instead of user invitation acceptance.
The Authorization Server Rest Controllers module operates within a multi-tenant context:
flowchart LR
Request["Incoming HTTP Request"] --> TenantFilter["Tenant Context Filter"]
TenantFilter --> SecurityChain["Spring Security Filter Chain"]
SecurityChain --> Controller["Authorization Controller"]
Controller --> Service["Domain Services"]
Key aspects:
clearAuthState to prevent stale authentication artifacts.seeOther (HTTP 303) for proper OAuth2 transitions.The module carefully uses HTTP semantics:
200 OK for successful synchronous operations.202 Accepted for asynchronous password reset token creation.204 No Content for successful reset confirmation.303 See Other for SSO redirect flows.Validation is handled through:
@Valid on request bodies.@Email and @NotBlank.Security-sensitive operations are delegated to services rather than implemented in controllers.
The Authorization Server Rest Controllers module:
It is a critical boundary layer that ensures:
HttpOnly, Secure, path-scoped.This structure keeps the Authorization Server modular, testable, and aligned with Spring Security and OAuth2 best practices in a multi-tenant SaaS environment.