Skip to main content
The Machine-to-Machine (M2M) authentication flow uses OAuth 2.0 Client Credentials for server-to-server integrations where no user interaction is required.

Overview

Obtaining Client Credentials

To authenticate using Client Credentials, you will need:
  • Client ID: Your integration SID (e.g., II9d19b343a93244b9df14104509a0b9b3)
  • Client Secret: Your integration secret
Contact your SmarterProctoring account manager to provision an integration and receive your credentials.

Token Endpoint

Request

Authenticate using HTTP Basic Auth with your Client ID as the username and Client Secret as the password.
Parameters:
  • grant_type (required): Must be client_credentials
  • scope (optional): Use smarter_iam to include IAM token in the response.

cURL Examples

Using HTTP Basic Auth (recommended):
Using form body parameters:

Scopes

For machine-to-machine authentication using Client Credentials, the following scope is available: Note: The smarter_iam scope is optional. When omitted, the access token still authenticates your client but may have reduced authorization context. The actual permissions are determined by the IAM policy attached to your integration.

Response

Response Fields:
  • access_token - The JWT access token to use in API requests
  • token_type - Always “Bearer”
  • expires_in - Number of seconds until the token expires (3600 = 1 hour)
  • expires_at - ISO 8601 UTC timestamp indicating when the token expires

Using the Access Token

Include the access token in the Authorization header of your API requests:

Error Responses

The API returns specific HTTP status codes and error messages to help you handle authentication and authorization issues:

401 Unauthorized

Returned when the request lacks valid authentication credentials or the token has expired. Response includes:
Action: Request a new access token using your Client Credentials.

403 Forbidden

Returned when the token is valid but the client does not have permission to perform the requested action on the specified resource. Example response:
Action: Verify your integration has the correct IAM policy permissions for the requested action and resource. Contact your account manager if you need additional permissions. Summary:
  • 401 = Authentication problem (invalid/missing/expired token)
  • 403 = Authorization problem (valid token, but wrong permissions)

Token Expiration

Access tokens have a default lifetime of 1 hour (3600 seconds) from the time of issuance. The exact expiration time is provided in the expires_at field as an ISO 8601 UTC timestamp. Token Expiration Behavior:
  • Tokens expire at the exact time specified in expires_at
  • Expiration is not based on inactivity (sliding window)
  • You must request a new token before the expiration time
  • Refresh tokens are not issued for machine-to-machine authentication
  • Token lifetime can be customized per integration - contact your account manager if you need a different TTL
Example expiration handling:

SDKs and Libraries

You can use standard OAuth 2.0 libraries to handle token generation and management: Node.js Python PHP Java C# Example using simple-oauth2 (Node.js):

Token Verification

Access tokens are signed JWTs that can be verified using SmarterServices’ published JSON Web Key Set:
Use this endpoint with any JWT verification library to validate token signatures, issuer (iss), audience (aud), and expiration (exp) claims locally without round-tripping to SmarterServices.

Token Security

  • Store your Client ID and Client Secret securely
  • Never expose credentials in client-side code or public repositories
  • Rotate secrets periodically
  • If your credentials are compromised, contact your SmarterProctoring account manager immediately to have them revoked and reissued

← Back to Authentication Overview