/v1/apps/{app_id}/auth-config/providers/oidc/discoverAuthCheck an OpenID Connect issuer before adding it as a sign-in provider.
Fetches `{issuer}/.well-known/openid-configuration` (https only, public addresses only, 5 s, no redirects) and returns what Auth would use: the authorize, token and key endpoints, scopes and claims. The document must name exactly this issuer. Nothing is saved; saving an `oidc-<key>` provider runs the same check and fails with 422 when it does not pass.
Path parameters
app_id*stringId of the app.
Request body
issuer*string · uriThe issuer to check: an https URL with no query or fragment, exactly as the provider names itself.
Example: "https://acme.okta.com"
Response · 200 The issuer answers with a usable discovery document.
issuer*string · uriThe issuer the discovery document names (equal to the one checked).
Example: "https://acme.okta.com"
authorization_endpoint*string · uriWhere sign-in sends people.
Example: "https://acme.okta.com/oauth2/v1/authorize"
token_endpoint*string · uriWhere Auth exchanges the sign-in code.
Example: "https://acme.okta.com/oauth2/v1/token"
jwks_uri*string · uriThe signing keys Auth verifies ID tokens with.
Example: "https://acme.okta.com/oauth2/v1/keys"
userinfo_endpoint*string · uriThe userinfo endpoint, if the provider lists one (not used by Auth).
Example: "https://acme.okta.com/oauth2/v1/userinfo"
scopes_supported*arrayScopes the provider says it supports, or null when it does not say.
Example: ["openid","email","profile"]
claims_supported*arrayClaims the provider says it can return, or null when it does not say. Use these names in `claim_mapping`.
Example: ["sub","email","email_verified","name"]
id_token_signing_algs*arrayID token signing algorithms Auth will accept from this provider (`none` and shared-secret algorithms removed).
Example: ["RS256"]
code_challenge_methods_supported*arrayPKCE methods the provider lists; Auth always sends S256.
Example: ["S256"]
token_endpoint_auth_methods_supported*arrayClient authentication methods at the token endpoint, for `token_endpoint_auth_method`.
Example: ["client_secret_basic","client_secret_post"]
Example
Request
POST https://api.auth.productcraft.co/v1/apps/{app_id}/auth-config/providers/oidc/discover
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"issuer": "https://acme.okta.com"
}import { Auth } from "@productcraft/auth";
// Admin routes read PRODUCTCRAFT_API_KEY; consumer routes need no key
const auth = new Auth();
const oidcDiscoveryResult = await auth.admin.app("3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f").authConfig.providers.discoverOidc({ issuer: "https://acme.okta.com" });auth.admin.app(…).authConfig.providers.discoverOidc(params, options?): Auth.OidcDiscoveryResult
Response
{
"issuer": "https://acme.okta.com",
"authorization_endpoint": "https://acme.okta.com/oauth2/v1/authorize",
"token_endpoint": "https://acme.okta.com/oauth2/v1/token",
"jwks_uri": "https://acme.okta.com/oauth2/v1/keys",
"userinfo_endpoint": "https://acme.okta.com/oauth2/v1/userinfo",
"scopes_supported": [
"openid",
"email",
"profile"
],
"claims_supported": [
"sub",
"email",
"email_verified",
"name"
],
"id_token_signing_algs": [
"RS256"
],
"code_challenge_methods_supported": [
"S256"
],
"token_endpoint_auth_methods_supported": [
"client_secret_basic",
"client_secret_post"
]
}