Skip to Content
OneRoster 1.2

Authentication

OAuth 2.0 client credentials, scopes and token lifetime.

Getting a token

  • Endpoint: POST https://<school>.<platform-domain>/oauth/token
  • Body: application/x-www-form-urlencoded (recommended, per OAuth 2.0) or JSON, with grant_type=client_credentials.
  • Credentials: client_id and client_secret with HTTP Basic (recommended) or in the body.
  • scope (optional): space-separated scopes. Empty means every scope of the connection.

The response carries Cache-Control: no-store. Call the API with Authorization: Bearer <access_token>.

Scopes

ScopeGrants read access to
https://purl.imsglobal.org/spec/or/v1p2/scope/roster-core.readonlyEvery Rostering endpoint
https://purl.imsglobal.org/spec/or/v1p2/scope/roster.readonlyEvery Rostering endpoint
https://purl.imsglobal.org/spec/or/v1p2/scope/gradebook.readonlyEvery Gradebook endpoint

Token lifetime

  • Tokens last one hour. Request a new one when it expires; there are no refresh tokens.
  • A token only works at the school that issued it.
  • When the school revokes a connection, all its tokens stop working at once.
  • The school can set an expiry (30, 90, 180, 365 days, or none) and limit the network addresses allowed to call.
  • The secret is shown only when the connection is created. If it is lost, the school presses Thay khoá (rotate) to issue a new one; the old one keeps working for 24 hours.
  • An access token connection (ttdn_pat_...) calls the OneRoster API directly with Authorization: Bearer, with no token request. See Portal API.

Never send the secret by chat or unencrypted email, and never commit it to source code. Keep it in the system's secret store.

Token errors

Per OAuth 2.0 (RFC 6749):

HTTPerrorWhen
401invalid_clientWrong id or secret, revoked connection, or another school's connection
400unsupported_grant_typegrant_type other than client_credentials
400invalid_scopeA scope the connection does not have
429slow_downMore than 60 token requests in 15 minutes from one network address
503temporarily_unavailableThe service is briefly unavailable; retry in a few minutes

On this page