ConnectSoft Identity Platform Flows¶
Each flow below describes the target-state behavior from frontend to backend. Implementation-specific pages may refine endpoint names, but must preserve these responsibilities.
Flow Overview¶
flowchart LR
shell["Blazor Shell / BFF"] -->|"login / logout / token renewal"| auth["Authorization Server"]
shell -->|"API calls"| gateway["API Gateway"]
mfe["Microfrontends"] -->|"API calls via Shell/Gateway"| gateway
auth -->|"internal identity contract"| identity["Identity Service"]
auth -->|"federation protocol"| provider["External IdP / Enterprise IdP"]
identity -->|"optional bind/sync"| ldap["LDAP / AD"]
gateway -->|"trusted identity + tenant context"| backend["Backend Services"]
backend -->|"domain authorization"| data["Domain Data"]
Shell Unauthenticated Startup¶
- User opens the Blazor Shell.
- Shell checks its local session/auth state.
- If no authenticated session exists, Shell renders public routes or starts login.
- Shell does not load protected MFE data until authentication succeeds.
- Protected API calls without a valid access token receive
401.
Shell Authenticated Startup¶
- Shell restores BFF cookie or token session.
- Shell loads user profile, tenant, roles, scopes, and MFA state.
- Shell exposes shared auth state to MFEs.
- MFEs render protected routes based on shared state.
- API access is still enforced by Gateway/backend.
Blazor WASM Authorization Code + PKCE Login¶
sequenceDiagram
autonumber
participant User
participant Shell as Blazor Shell
participant Auth as Authorization Server
participant Identity as Identity Service
participant Gateway as API Gateway
participant Backend as Backend Service
User->>Shell: Open protected route
Shell->>Auth: /connect/authorize with state, nonce, PKCE challenge
Auth->>Identity: Evaluate sign-in / retrieve normalized user state
Identity-->>Auth: User, tenant, roles, claims, MFA requirement
Auth-->>Shell: Authorization code
Shell->>Auth: /connect/token with code + PKCE verifier
Auth-->>Shell: id_token + access_token (+ refresh_token when allowed)
Shell->>Gateway: API request with access_token
Gateway->>Gateway: Validate token, route policy, tenant, MFA claims
Gateway->>Backend: Forward request with trusted context
Backend-->>Gateway: Domain response
Gateway-->>Shell: API response
- Shell redirects the user to Authorization Server
/connect/authorize. - Request includes
client_id,redirect_uri,scope,state,nonce, and PKCE challenge. - Authorization Server authenticates the user locally or through federation.
- Authorization Server returns authorization code to Shell callback.
- Shell exchanges code and verifier at
/connect/token. - Authorization Server issues
id_token,access_token, and optionallyrefresh_token. - Shell stores access token only as permitted by the frontend security model and uses it for Gateway calls.
Failure paths: invalid redirect URI, missing PKCE, denied consent, failed MFA, invalid client, or account linking required.
Blazor Server or BFF Login¶
- Browser reaches Shell or BFF.
- Shell/BFF starts OIDC login with Authorization Server.
- Tokens are stored server-side.
- Browser receives HttpOnly/SameSite cookie.
- Shell and MFEs call APIs through BFF or Gateway.
- CSRF protection is required for cookie-authenticated write operations.
Local Registration¶
- User opens Identity Self-Service MFE.
- MFE calls Identity registration through Gateway or approved BFF route.
- Identity creates the local user in pending/active state according to policy.
- Identity sends email or phone confirmation when required.
- User confirms and then logs in through Authorization Server.
- Authorization Server issues platform tokens after successful login.
Registration does not issue platform access tokens by itself.
Email and Phone Confirmation¶
- Identity creates confirmation token and sends it through configured channel.
- User follows confirmation link or submits code.
- Identity validates the token/code.
- Identity updates user confirmation state.
- Authorization Server can include confirmed email/phone claims when allowed by requested scopes.
Local Password Login¶
sequenceDiagram
autonumber
participant User
participant Auth as Authorization Server
participant Identity as Identity Service
participant Mfa as MFA Factor
User->>Auth: Submit username/password
Auth->>Identity: EvaluateSignInAsync
Identity-->>Auth: Credential/account result + MFA requirement
alt MFA required
Auth->>Identity: CreateMfaChallengeAsync
Identity-->>Auth: Challenge continuation
Auth-->>User: Prompt for MFA
User->>Auth: Submit MFA proof
Auth->>Identity: VerifyMfaChallengeAsync
Identity->>Mfa: Verify factor when needed
Mfa-->>Identity: Factor result
Identity-->>Auth: MFA verified
end
Auth->>Identity: GetUserClaimsAsync
Identity-->>Auth: Normalized claims and tenant memberships
Auth-->>User: Platform tokens / session
- Authorization Server receives an interactive login or allowed password validation request.
- Authorization Server delegates credential verification to Identity.
- Identity validates password, lockout, status, and MFA requirement.
- If MFA is required, login pauses until MFA succeeds.
- Authorization Server issues tokens after all required checks pass.
Password Reset and Change Password¶
Password reset is self-service and starts unauthenticated with rate limiting. Identity validates reset tokens and updates credentials. Change password is authenticated and should require current password and, for sensitive environments, step-up MFA.
MFA Enrollment¶
- Authenticated user opens Identity Self-Service MFE.
- MFE requests MFA enrollment from Identity.
- Identity creates factor setup data, such as TOTP secret and recovery codes.
- User verifies the first challenge.
- Identity marks MFA enabled.
- Future token issuance can include stronger
amr/acrafter MFA is completed.
MFA Login Challenge¶
- Identity determines MFA is required after primary authentication.
- User completes TOTP, recovery code, passkey, or approved factor.
- Identity records successful MFA for the login transaction.
- Authorization Server emits
amr/acrclaims that reflect MFA.
Step-Up MFA¶
- User with an active session attempts a sensitive operation.
- Gateway or backend detects missing or insufficient MFA assurance.
- API returns
mfa_requiredor Shell starts an authorization request with strongeracr_values. - User completes MFA.
- Authorization Server issues a new token or session state with stronger assurance.
- Shell retries the sensitive operation.
Sensitive operations include admin client changes, MFA reset, payment/payout actions, tenant deletion, and privileged data export.
Consent¶
- Authorization Server evaluates client, scopes, and consent policy.
- If consent is required, the user is redirected to consent UI.
- User grants or denies requested scopes.
- Authorization Server records consent according to policy.
- Token issuance continues only after consent is granted.
UserInfo¶
- Client calls UserInfo with a valid access token.
- Authorization Server validates token and requested scopes.
- Authorization Server retrieves normalized claims from Identity.
- Response includes only claims allowed by granted scopes.
Refresh Token Rotation¶
sequenceDiagram
autonumber
participant Shell as Shell / BFF
participant Auth as Authorization Server
participant Identity as Identity Service
Shell->>Auth: /connect/token grant_type=refresh_token
Auth->>Auth: Validate refresh token, client, session, revocation
opt Revalidate user state
Auth->>Identity: GetUserClaimsAsync / user state check
Identity-->>Auth: Current claims, status, security stamp
end
Auth-->>Shell: New access token and rotated refresh token
- Access token expires or nears expiry.
- Shell/BFF calls
/connect/tokenwithgrant_type=refresh_token. - Authorization Server validates refresh token, client, session, and revocation state.
- Authorization Server issues new access token and rotates refresh token where configured.
- Reuse of an old refresh token is treated as suspicious.
Logout, Revocation, and Session Expiry¶
sequenceDiagram
autonumber
participant User
participant Shell
participant Auth as Authorization Server
participant Provider as Federated Provider
participant MFE as Microfrontends
User->>Shell: Logout
Shell->>Auth: Logout / revocation request
Auth->>Auth: End local session and revoke refresh tokens when configured
opt Federated logout configured
Auth->>Provider: Federated logout
Provider-->>Auth: Logout response
end
Auth-->>Shell: Logout complete
Shell->>MFE: Clear shared auth state
- User initiates logout from Shell.
- Shell redirects or calls Authorization Server logout endpoint.
- Authorization Server ends local session and revokes refresh tokens where applicable.
- Shell clears local auth state and notifies MFEs.
- Optional federated logout is attempted when configured.
- Existing JWT access tokens remain valid until expiry unless reference tokens or introspection are used.
API Gateway Protected Request¶
sequenceDiagram
autonumber
participant MFE as Shell / MFE
participant Gateway as API Gateway
participant Backend as Backend Service
MFE->>Gateway: Request with Bearer access_token
Gateway->>Gateway: Validate issuer, audience, signature, expiry
Gateway->>Gateway: Evaluate route policy, tenant, scopes, roles, MFA
Gateway->>Gateway: Strip spoofed trusted headers
Gateway->>Backend: Forward with trusted identity, tenant, correlation headers
Backend->>Backend: Enforce tenant isolation and resource authorization
Backend-->>Gateway: Domain response
Gateway-->>MFE: API response or ProblemDetails
- MFE calls Gateway with
Authorization: Bearer <access_token>. - Gateway validates issuer, audience, signature, expiry, and route policy.
- Gateway resolves tenant from validated token/context.
- Gateway forwards request and trusted context to backend.
- Backend performs domain authorization and returns response.
Failures: 401 for invalid/missing token, 403 for insufficient policy, mfa_required for step-up.
Backend Domain Authorization¶
- Backend receives validated caller context.
- Backend maps claims to current user and tenant context.
- Backend checks ownership, tenant isolation, role, permission, and aggregate-specific rules.
- Backend records audit context for sensitive operations.
Identity Admin Flows¶
Identity Admin MFE calls Gateway-protected Identity admin APIs. Required policy is identity.admin, with step-up MFA for sensitive operations such as MFA reset, external link removal, role elevation, tenant membership changes, and account disablement.
Authorization Server Admin Flows¶
Authorization Server Admin MFE manages clients, scopes, consent policy, token lifetimes, federation providers, and signing key visibility where supported. Required policy is auth.admin, with step-up MFA for client secret rotation, signing key changes, and high-privilege client updates.
Social Federation: Google and Facebook¶
sequenceDiagram
autonumber
participant User
participant Auth as Authorization Server
participant Provider as Google / Facebook
participant Identity as Identity Service
User->>Auth: Start login and choose provider
Auth->>Provider: Authorization request
Provider-->>Auth: Authorization response / external identity
Auth->>Auth: Validate state, nonce, issuer, audience, signature
Auth->>Identity: ResolveFederatedLoginAsync
alt Link exists
Identity-->>Auth: Internal user and normalized claims source
else JIT/linking allowed
Identity->>Identity: Create user, memberships, external link
Identity-->>Auth: Internal user and normalized claims source
else Approval/profile completion required
Identity-->>Auth: account_link_required
end
Auth-->>User: Platform tokens or linking UX
- User starts login at Authorization Server.
- User selects Google or Facebook.
- Authorization Server redirects to provider.
- Provider authenticates user and returns authorization response.
- Authorization Server validates provider response.
- Identity resolves existing external account link or starts account linking/JIT provisioning.
- Authorization Server issues ConnectSoft platform tokens.
Provider tokens are not forwarded to backend APIs.
Enterprise Federation: Keycloak, Entra ID, and AD FS¶
sequenceDiagram
autonumber
participant User
participant Auth as Authorization Server
participant Provider as Keycloak / Entra ID / AD FS
participant Identity as Identity Service
User->>Auth: Start tenant/domain-specific login
Auth->>Provider: OIDC or SAML request
Provider-->>Auth: Enterprise identity response
Auth->>Auth: Validate issuer, audience, signature, nonce/state, replay protection
Auth->>Identity: ResolveFederatedLoginAsync with subject/groups
Identity->>Identity: Map groups to roles, scopes, tenant memberships
Identity-->>Auth: Internal user and normalized claims
Auth-->>User: Platform tokens
- Authorization Server selects enterprise provider by tenant, domain, user choice, or route.
- User authenticates through OIDC or SAML.
- Authorization Server validates response, issuer, audience, signature, nonce/state, and replay protections.
- Identity maps external subject and groups to internal user, roles, scopes, and tenant memberships.
- Authorization Server emits platform tokens.
LDAP and Active Directory¶
flowchart TB
browser["Browser / MFE"] -. "not allowed: never direct" .-> ldap["LDAP / AD"]
auth["Authorization Server"] -->|"delegates local sign-in"| identity["Identity Service"]
identity -->|"LDAP bind pattern"| ldap
identity -->|"sync users/groups pattern"| identityStore["Identity Store"]
auth -->|"federation bridge pattern"| bridge["Keycloak / Entra ID / AD FS"]
bridge -->|"directory integration"| ldap
Supported patterns:
- Identity performs LDAP bind for credential validation.
- Identity syncs users/groups from LDAP/AD into its own store.
- Keycloak, Entra ID, or AD FS bridges LDAP/AD, and Authorization Server federates to that provider.
Browsers and MFEs never connect directly to LDAP.
JIT Provisioning¶
- Federated user authenticates successfully.
- Identity cannot find an existing external link.
- Identity applies tenant and provider policy.
- Identity creates internal user, memberships, and external link when allowed.
- If policy requires approval or profile completion, login pauses with
account_link_requiredor equivalent UX.
Account Linking and Unlinking¶
Account linking connects an external provider subject to an internal user. Linking requires proof of both accounts or an admin-approved workflow. Unlinking is blocked when it would remove the user's last valid login method unless an admin recovery policy exists.
Service-to-Service Client Credentials¶
sequenceDiagram
autonumber
participant Client as Service Client
participant Auth as Authorization Server
participant Gateway as API Gateway
participant Backend as Backend Service
Client->>Auth: Client credentials or certificate
Auth->>Auth: Validate client, secret/cert, scopes
Auth-->>Client: Service access token with client_id and scopes
Client->>Gateway: API request with service token
Gateway->>Gateway: Validate token and service policy
Gateway->>Backend: Forward trusted client context
Backend->>Backend: Enforce service-level authorization and audit
Backend-->>Gateway: Domain response
Gateway-->>Client: API response
- Service client authenticates to Authorization Server.
- Authorization Server validates client credentials or certificate.
- Authorization Server issues service access token with service scopes and
client_id. - API Gateway/backend validates service token and service policy.
- Backend applies service-level authorization and audit.
Mock Provider Development Flows¶
Mock social, enterprise, and LDAP providers must implement the same contracts as real providers:
- deterministic external subject;
- configurable email, name, tenant, groups, and MFA state;
- failure modes for denied login, missing email, duplicate account, stale group, and account linking required.
Mock providers are development substitutes, not production assurance.