OAuth 2.1 · OpenID Connect
Sign in with Pryma ID
One button, and your app knows who the student is, where they study, and what they are registered for — without asking them to type any of it, and without you storing a password.
Try it
This is the real button, rendered by the real script. It will take you through the actual consent screen.
Rendered by the same script the snippet below installs.
1. Add the button
One script tag. It generates a PKCE verifier, keeps it in sessionStorage, and sends the student to the consent screen.
<script src="https://www.prymaid.me/pryma-signin.js"></script>
<div data-pryma-signin
data-client-id="YOUR_CLIENT_ID"
data-redirect-uri="https://your.app/callback"
data-scope="openid profile institution read:registered_courses"></div>html2. Handle the redirect
On your callback page, read the code and verifier, then pass them to your own backend.
// your.app/callback — in the browser
const { code, codeVerifier } = PrymaID.handleCallback();
// Hand both to your own server. The token exchange needs your client
// secret, so it must not happen in the page.
await fetch("/api/pryma/finish", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ code, codeVerifier }),
});js3. Exchange the code, on your server
The client secret never belongs in a browser, so this last step is server-side. Ten lines, then you have the student's record.
// your server — POST /api/pryma/finish
const res = await fetch("https://www.prymaid.me/api/auth/token", {
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
Authorization: "Basic " + Buffer
.from(`${PRYMA_CLIENT_ID}:${PRYMA_CLIENT_SECRET}`)
.toString("base64"),
},
body: new URLSearchParams({
grant_type: "authorization_code",
code,
code_verifier: codeVerifier,
redirect_uri: "https://your.app/callback",
}),
});
const { access_token } = await res.json();
// Everything the student agreed to share, already filled in.
const me = await fetch("https://www.prymaid.me/oauth/userinfo", {
headers: { Authorization: `Bearer ${access_token}` },
}).then((r) => r.json());
// → { sub, name, email, institution_name, level, department,
// registered_courses: [{ code, title, units }], ... }tsScopes
Ask only for what your app actually needs. The student sees the requested permissions and can accept or deny the request. The authorization endpoint rejects a scope your client was not registered for — so a timetable app cannot quietly read an academic record.
| Scope | Gives you |
|---|---|
| See your email address | |
| institution | See your university and affiliation status |
| openid | Confirm who you are (your Pryma ID) |
| profile | See your name, username and profile picture |
| read:academic_record | Read your matric number, level, department and faculty |
| read:enrollment_status | Check whether you are an active, suspended or graduated student |
| read:profile | Read your basic profile |
| read:registered_courses | Read your registered courses for the current semester |
| read:timetable | Read your class timetable (days, times and venues) |
Endpoints
Standard OpenID Connect. If your language has an OIDC library, point it at the discovery document and you are done.
https://www.prymaid.me/.well-known/openid-configurationtext- Authorization
- /api/auth/authorize
- Token
- /api/auth/token
- UserInfo
- /oauth/userinfo
- Revocation
- /api/auth/revoke
- JWKS
- /.well-known/jwks.json
What we require
- PKCE, S256, always. Not optional, and
plainis rejected. - Exact redirect URIs. Matched as whole strings — no wildcards, no prefix matching.
- Authorization code only. Implicit and password grants do not exist here.
- Refresh tokens rotate. Replaying a used one revokes the whole session, so a stolen token is worth one request and then nothing.
- DPoP is supported. Sender-constrain your tokens and a stolen one is useless without your key.
Get a client ID
Register your app from the dashboard. You will get a client ID and a secret shown once, and you choose which scopes it may ever ask for.
Go to your apps