Overview
Obtaining Client Credentials
Contact your SmarterProctoring account manager to:- Register your application as an OIDC client
- Receive your Client ID (Integration SID)
- Receive your Client Secret
- Register your Redirect URI(s) - Must be HTTPS
- Configure additional options:
- PKCE requirement - Recommended for public clients
- Consent display policy -
never,once, oralways - Token lifetimes - Custom access/refresh token TTLs
- Back-channel logout URI - For session synchronization
Step 1: Redirect User to Authorization Endpoint
When a user wants to authenticate, redirect them to:
Example redirect URL:
PKCE (Proof Key for Code Exchange)
PKCE is strongly recommended for all clients and required for public clients (SPAs, mobile apps) where the client secret cannot be securely stored. Generating the code challenge:code_challenge and code_challenge_method=S256 in the authorization request, then provide the original code_verifier when exchanging the code for tokens.
Security Recommendations
- Always include
state- Generate a cryptographically random value, store it in session, and validate it matches in the callback - Include
nonce- Required for ID token validation to prevent replay attacks - Use PKCE - Required for public clients, recommended for all
- Validate
redirect_uri- Must exactly match a registered URI (no wildcards)
Step 2: User Authenticates
The user will be presented with a SmarterServices login page where they:- Enter their credentials (email/password)
- Complete Multi-Factor Authentication (if enabled for their account)
- Grant consent (based on your integration’s consent policy)
Consent Display Policy
The consent screen behavior is configured per integration:
The consent screen displays:
- Your application name
- The list of requested scopes (in human-readable form)
- The redirect destination
- Allow and Deny buttons
redirect_uri with error=access_denied.
Contact your account manager to configure your integration’s consent policy.
Step 3: Handle the Authorization Callback
After successful authentication, the user is redirected back to yourredirect_uri:
state parameter matches what you sent to prevent CSRF attacks.
Error handling: If authentication fails, you’ll receive:
Step 4: Exchange Code for Tokens
Send a POST request to the token endpoint to exchange the authorization code for tokens:
Authorization codes are single-use and expire after 10 minutes.
Token Response
access_token- JWT for accessing API resources on behalf of the userid_token- JWT containing user identity claims (name, email, etc.)refresh_token- Token to obtain new access tokens (when enabled)expires_in/expires_at- Access token expiration (1 hour)
ID Token Claims
The ID token contains user identity information:Scopes for User Authentication
Example scope request:
Using the Access Token
Include the access token in the Authorization header when calling API endpoints:Refresh Tokens
When refresh tokens are enabled for your integration, you can obtain a new access token without requiring the user to re-authenticate:- Lifetime: Configurable per integration (default 7 days, can be set up to indefinite)
- Revocation: All tokens in a grant family are revoked together when the user logs out
- Single-grant scope: Each refresh token belongs to a specific user + integration combination
UserInfo Endpoint
Retrieve the authenticated user’s profile information using the access token:Logout
Front-Channel Logout
To log out a user, revoke their tokens:Back-Channel Logout
If you’ve registered abackchannel_logout_uri for your integration, SmarterServices will notify your application when a user’s session is terminated (for example, when they log out of another connected application or when their account is suspended).
Notification format:
logout_token is a signed JWT containing:
- Verify the
logout_tokensignature using the JWKS endpoint - Validate
iss,aud, andeventsclaims - Terminate the user’s local session(s) for the
sub(user ID) - Respond with
200 OK
Error Responses
Authorization Endpoint Errors
When errors occur during the authorization request, the user is redirected back to yourredirect_uri with error parameters:
Example error redirect:
Token Endpoint Errors
Returned as JSON with HTTP status 400:401 Unauthorized
Returned when the request lacks valid authentication credentials or the token has expired. Response includes:403 Forbidden
Returned when the token is valid but the user does not have permission for the requested action.SDKs and Libraries
Node.jsopenid-client- OpenID Connect client for Node.jspassport-openidconnect- Passport strategy for OIDC
spring-security-oauth2-client- Spring Security OAuth 2.0 Clientpac4j- Security engine for Java
league/oauth2-client- OAuth 2.0 client for PHP
Token Verification
ID tokens and access tokens are JWTs signed with RSA keys. Use the JWKS endpoint to retrieve public keys for verification:- Verify the JWT signature using the matching key from JWKS
- Validate
issmatcheshttps://api.smarterservices.com/oidc - Validate
audmatches yourclient_id - Validate
expis in the future - Validate
noncematches the value you sent in the authorization request - Validate
iatis reasonably recent
Token Security
- Store tokens securely - Encrypt at rest, use secure storage (Keychain, KeyStore, etc.)
- Use HTTPS - All redirect URIs must use HTTPS
- Validate
state- Always verify the state parameter matches - Validate ID token - Verify signature, issuer, audience, expiration, and nonce
- Short-lived access tokens - Default 1 hour lifetime
- Secure refresh tokens - Store separately from access tokens, encrypt at rest
- Implement logout - Revoke tokens when user logs out
- Use PKCE - Especially for public clients
- Monitor for abuse - Log and alert on suspicious token usage
← Back to Authentication Overview
