Implement Yoursafe ID
Raw skill fileYoursafe ID is OpenID Connect. The live discovery document is the source for endpoint URLs. If this skill and a product page disagree, follow the product page.
Read first
- Getting Started
- Integration
- Endpoint Reference
- Claims Glossary for the scopes you request
- Alias Token Queries only when you look up a public alias
Implement in this order
- Register the client and the exact redirect URI.
- On each sign-in, create
stateandnonceon the server and store them before the redirect. - Send the user to the authorization endpoint from discovery.
- On the callback, reject the request unless
statematches, then exchange the code on the server. - Validate the
id_tokensignature, issuer, audience, expiry, andnoncebefore creating a session. - Call userinfo with the access token, and only for claims the scopes allow.
Credentials
- Client id and client secret from the Yoursafe ID client registration.
- The secret stays on the server. The browser never sees it.
- Discovery host is
accounts.yoursafe.com. Read/.well-known/openid-configurationand use those URLs.
Traps
- The redirect URI has to match the registered value exactly. A trailing slash or a different port is a different URI.
- A callback with a
stateornonceyou did not store is not a login you started. - Token exchange and refresh run on the server. Use the client authentication method discovery advertises,
client_secret_basicorclient_secret_post. - Alias lookups are a different host. Query
https://<aliastoken>.yoursafe.id/?json=1, notaccounts.yoursafe.com.
Done when
A user can sign in, the callback rejects a mismatched state, the id_token is verified before a session exists, and claims come from userinfo or the token.