This flow applies to apps you created in My apps.
Integrations set up before My apps may still use the password grant described in
Authentication.
S256) against the Ed Controls identity service. It is standard
OpenID Connect, so any certified OAuth or OIDC library works. The password grant
and the client credentials grant are not available to these apps.
Prefer configuring your library from the discovery URL over hardcoding the
endpoints.
1. Send the user to sign in
Generate a randomcode_verifier, derive code_challenge = BASE64URL(SHA256(code_verifier)),
and redirect the browser to:
redirect_uri must match one of your app’s redirect URIs exactly. The
user signs in with their Ed Controls account and is shown a consent screen
listing your app’s name and the scopes it asks for.
2. Exchange the code for tokens
Ed Controls redirects back to yourredirect_uri with code and state.
Check that state is the one you sent, then:
access_token (a JWT with an expires_in), a
refresh_token and, with the openid scope, an id_token. Send the access
token as Authorization: Bearer <token> to the API. It carries the API’s
audience (edcontrols-api) and the signed-in user’s identity.
3. Refresh
Access tokens are short-lived. Get a new one with the refresh token before or when a call returns401:
Scopes
A scope bounds what your app asks for. What it may actually do is still decided
by the signed-in user’s roles, exactly as in the
Ed Controls app.
Long-running integrations
For a background job (an ERP sync, a nightly export) that runs without a person present:- Create a dedicated Ed Controls user for it, a service account, and give it only the project roles it needs.
- Sign in through your app once as that user, with
offline_accessin the scope, and approve the consent screen. - Store the refresh token in your secret manager and use it to get access tokens from then on.
