Why domains matter in OAuth
In OAuth and OpenID Connect (OIDC), many core features rely on a single authoritative domain. The most important of these is the issuer — a required field in Access and ID token JWTs that uniquely identifies your Stytch application as the entity that created the token. Consumers of these JWTs use the issuer during validation to ensure the token’s authenticity. Another key feature is the set of well-known metadata URLs, which OAuth clients use to automatically discover server configuration. These endpoints expose metadata about available capabilities and supported flows.- For OAuth:
https://<domain>/.well-known/oauth-authorization-server - For OIDC:
https://<domain>/.well-known/openid-configuration
Configuring Stytch SDKs to use your domain
Stytch SDKs must be configured to use the correct domain for your project. For B2B applications:How Custom Domains affect Connected Apps
Stytch will dynamically determine JWT issuers and well-known URL responses based on the domain used to access the Stytch service.Using the default project domain
All Stytch projects are provisioned a unique default domain upon creation.- In
testenvironments, the domain will look likehttps://{noun}-{verb}-{number}.customers.stytch.dev. - In
liveenvironments, the domain will look likehttps://{noun}-{verb}-{number}.customers.stytch.dev.
issuer of https://{noun}-{verb}-{number}.customers.stytch.dev.
https://{noun}-{verb}-{number}.customers.stytch.dev:
Using a branded custom domain (CNAME)
When you configure a custom domain (e.g.https://login.yourcompany.com) and make API calls using that domain, Stytch will use that domain instead.
The Access token and ID token returned from this call will have an issuer of https://login.yourcompany.com.
https://login.yourcompany.com domain:
Migrating from api.stytch.com
If you were an early customer of Connected Apps, you may be accessing the product overapi.stytch.com - e.g. https://api.stytch.com/v1/public/${projectId}/oauth2/token. When accessed this way, Stytch will use the project ID (stytch.com/$projectId) as the issuer. These issuers are not OpenID Connect (OIDC) compliant, as they are not HTTPS URLs.
Why does this matter?
- Many OIDC clients and libraries will reject tokens if the
issuerdoes not match the expectedhttpsURL. - Using a custom domain ensures maximum compatibility and security for your integrations.
To get a fully OIDC-compliant issuer:
- Set up a custom domain (CNAME) in your DNS that points to Stytch and configure Stytch to recognize this domain.
- Configure your application to make all API calls to Stytch over this domain.
- Use this domain for all authentication flows.