Discover OIDC Endpoints

POST /v1/sso/config/discover

Given a custom OIDC provider's issuer URL, fetch its .well-known/openid-configuration and return the endpoint URLs you need to create an oidc SSO config. This is a pure read — it does not create or modify any config — and is what the dashboard's Discover button calls so an admin can paste one issuer URL and have auth_url, token_url, userinfo_url, issuer, and jwks_url filled in automatically.

Works with any OIDC-compliant IdP that publishes a discovery document — Okta, Microsoft Entra ID, Auth0, and others. google / github configs don't need this (their endpoints are platform-controlled).

Plan-gated: requires the account's sso entitlement (discovery is part of SSO setup). Permission-gated: requires the settings:read account permission.

Request body

issuer_url string Req
The provider's OIDC issuer URL (e.g. https://acme.okta.com/oauth2/default). The standard /.well-known/openid-configuration suffix is appended if you don't include it. Must be https and resolve to a public host.

Response (200 OK)

The provider's parsed discovery document. Map the fields onto the SSO config as noted:

issuer string
→ issuer. The canonical issuer identifier the provider asserts in the id_token iss claim.
authorization_endpoint string
→ auth_url.
token_endpoint string
→ token_url.
userinfo_endpoint string
→ userinfo_url.
jwks_uri string
→ jwks_url. The signing-key endpoint used to verify the id_token at login.
scopes_supported string[]
Scopes the provider advertises. Informational — ngris defaults to openid profile email.

Errors

400 Bad Request
Missing issuer_url, or discovery failed — e.g. the URL isn't https, the host is unreachable or private, or the document isn't valid OIDC discovery JSON. The message explains what went wrong.
401 Unauthorized
Missing auth.
403 Forbidden
No active account, the caller lacks settings:read, or the account plan doesn't include the sso entitlement.
Request
curl -X POST "https://api.ngris.com/v1/sso/config/discover" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"issuer_url": "https://acme.okta.com/oauth2/default"}'
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") doc = client._post_raw("/sso/config/discover", {"issuer_url": "https://acme.okta.com/oauth2/default"}) # Feed the discovered endpoints straight into create() client.sso.create({ "email_domain": "acme.com", "provider_type": "oidc", "client_id": "0oa1234abc", "client_secret": "<idp-client-secret>", "auth_url": doc["authorization_endpoint"], "token_url": doc["token_endpoint"], "userinfo_url": doc["userinfo_endpoint"], "issuer": doc["issuer"], "jwks_url": doc["jwks_uri"], })
Response — 200 OK
{ "issuer": "https://acme.okta.com/oauth2/default", "authorization_endpoint": "https://acme.okta.com/oauth2/default/v1/authorize", "token_endpoint": "https://acme.okta.com/oauth2/default/v1/token", "userinfo_endpoint": "https://acme.okta.com/oauth2/default/v1/userinfo", "jwks_uri": "https://acme.okta.com/oauth2/default/v1/keys", "scopes_supported": ["openid", "profile", "email"] }