SSO with Okta
For: an app developer, or the Okta admin of a customer, who connects the customer’s Okta org to an organization.
What it does: this page gives the steps in the Okta Admin Console for an OIDC connection and for a SAML connection. Each field name is the name on the Okta pages that the last table lists, with the date of each read.
Before you start
Section titled “Before you start”- A verified domain of the organization, by the steps of Enterprise SSO.
- An Okta admin of the customer who may create app integrations (Okta help).
Pick one kind. OIDC needs fewer values.
- In the Admin Console, go to “Applications and Resources” > “Applications”.
- Select “Create App Integration”, then “OIDC - OpenID Connect”, then “Web Application”.
- Under “Grant type”, keep “Authorization code”.
- Under “Assignments”, pick the people or groups that may sign in.
- Save. Copy the “Client ID”.
- Under “Client authentication”, select “Client secret”, and copy the secret. Okta sends it by the method
client_secret_basic. The fieldtoken_endpoint_auth_methodof the Okta Apps API changes it. - Create the connection with the Okta domain and the values of steps 5 and 6, as
oktaOidcbelow does. - In “Sign-in redirect URIs”, enter
<baseURL><basePath>/sso/<connectionId>/callback.
The issuer is the org authorization server: https://<your Okta domain>. Core reads its discovery document at /.well-known/openid-configuration.
Core sends the client secret by the method of the connection, tokenEndpointAuthMethod. Both methods work with Okta:
client_secret_basic: the secret goes in the HTTP Basic header of the token request. Okta gives a new app this method, sooktaOidcbelow sets it.client_secret_post: the secret goes in the body of the token request. It is the default of a connection. Pass it tooktaOidcfor an app that you set to this method.
The method of the connection must be the method of the app. Else Okta refuses the token request of each sign-in, and the sign-in answers sso_failed.
- Go to “Applications and Resources” > “Applications” > “Create App Integration”.
- Select “Classic experience”, then “SAML 2.0” as the sign-in method.
- Enter a name, then go on to the SAML settings.
- Enter a temporary https URL in “Single sign-on URL” and “Audience URI (SP Entity ID)”.
- Set “Name ID format” to the persistent format.
- Under “Attribute Statements”, add the name
email, the format “Basic”, and the email address as the value. - Finish the integration. On the “Sign On” tab, open “View SAML setup instructions”.
- Create the connection with the sign-in URL, the issuer, and the certificate there, as
oktaSamlbelow does. - Enter the
acsUrlof the connection in “Single sign-on URL”. - Keep “Use this for Recipient URL and Destination URL” selected.
- Enter the
spEntityIdof the connection in “Audience URI (SP Entity ID)”. - Assign the people of the customer to the app.
Core asks for the persistent NameID format when the connection has no subjectAttribute. Then core refuses a transient NameID. Okta needs the “Name ID format” to match the format of a request that names one.
Under “Show Advanced Settings”, the “Assertion Signature” must be signed. Pick an RSA SHA-256 “Signature Algorithm” and the SHA-256 “Digest Algorithm”. Core refuses SHA-1.
import type { ConnectionInput } from "@authtempo/core";
/** * An Okta app integration of the kind "OIDC - OpenID Connect" as an OIDC * connection. The issuer is the org authorization server of the Okta org. * Okta gives a new app the method `client_secret_basic`. Pass * `client_secret_post` for an app that you set to that method. */export function oktaOidc(input: { organizationId: string; oktaDomain: string; clientId: string; clientSecret: string; tokenEndpointAuthMethod?: "client_secret_basic" | "client_secret_post";}): ConnectionInput { return { organizationId: input.organizationId, kind: "oidc", label: "Sign in with Okta", issuer: `https://${input.oktaDomain}`, clientId: input.clientId, clientSecret: input.clientSecret, tokenEndpointAuthMethod: input.tokenEndpointAuthMethod ?? "client_secret_basic", };}
/** * An Okta app integration of the kind "SAML 2.0" as a SAML connection, with * the sign-in URL, the issuer, and the certificate that "View SAML setup * instructions" of the "Sign On" tab shows. */export function oktaSaml(input: { organizationId: string; ssoUrl: string; issuer: string; certificatePem: string;}): ConnectionInput { return { organizationId: input.organizationId, kind: "saml", label: "Sign in with Okta", idpEntityId: input.issuer, ssoUrl: input.ssoUrl, certificates: [input.certificatePem], // The attribute statement with the name email. attributes: { email: "email", name: null }, };}import { createAuth, type DnsTxtPort } from "@authtempo/core";import { createTestIdp } from "@authtempo/core/testing";import { describe, expect, it } from "vitest";import { API, call, harness, signIn } from "../support/harness.ts";import { entraOidc, entraSaml } from "./sso-entra.ts";import { googleOidc, googleSaml } from "./sso-google.ts";import { oktaOidc, oktaSaml } from "./sso-okta.ts";
const APP = { kind: "app", name: "admin-page" } as const;
/** An app with OIDC and SAML connections on, and one organization of an owner. */async function setup() { const h = harness(); const dns: DnsTxtPort[] = [{ name: "a", txt: async () => [] }]; const auth = createAuth({ baseURL: API, trustedOrigins: [], secret: h.secret, storage: h.storage, mail: h.mail, organizations: {}, sso: { oidc: true, saml: true, dns }, }); const owner = await signIn(auth, h, "owner@owner.example"); const made = await call( auth, "POST", "/auth/organizations/create", { slug: "acme", name: "Acme" }, { cookie: owner }, ); const { organization } = (await made.json()) as { organization: { id: string } }; const sso = auth.api.sso; if (!sso) throw new Error("sso is off"); return { sso, organizationId: organization.id };}
describe("the connection of each provider", () => { it("takes the OIDC values of Entra ID, Okta, and Google", async () => { const { sso, organizationId } = await setup(); const inputs = [ entraOidc({ organizationId, tenantId: "aaaabbbb-0000-cccc-1111-dddd2222eeee", clientId: "client-1", clientSecret: "secret-1", }), oktaOidc({ organizationId, oktaDomain: "acme.okta.com", clientId: "client-2", clientSecret: "secret-2", }), googleOidc({ organizationId, clientId: "client-3", clientSecret: "secret-3" }), ]; const issuers: string[] = []; const methods: string[] = []; for (const input of inputs) { const made = await sso.connections.create({ actor: APP, ...input }); if (!made.ok) throw new Error(`${made.code} ${made.message ?? ""}`); issuers.push(made.value.oidc?.issuer ?? ""); methods.push(made.value.oidc?.tokenEndpointAuthMethod ?? ""); // No answer holds the client secret. expect(JSON.stringify(made.value)).not.toContain("secret-"); } expect(issuers).toEqual([ "https://login.microsoftonline.com/aaaabbbb-0000-cccc-1111-dddd2222eeee/v2.0", "https://acme.okta.com", "https://accounts.google.com", ]); // Okta's default method is HTTP Basic; Entra ID and Google take the default of a connection. expect(methods).toEqual(["client_secret_post", "client_secret_basic", "client_secret_post"]); });
it("takes the SAML values of Entra ID, Okta, and Google, and answers the values for the provider", async () => { const { sso, organizationId } = await setup(); const idp = await createTestIdp({ alg: "rsa" }); const inputs = [ entraSaml({ organizationId, loginUrl: "https://login.microsoftonline.com/aaaabbbb-0000-cccc-1111-dddd2222eeee/saml2", entraIdentifier: "https://sts.windows.net/aaaabbbb-0000-cccc-1111-dddd2222eeee/", certificatePem: idp.certificatePem, }), oktaSaml({ organizationId, ssoUrl: "https://acme.okta.com/app/acme/sso/saml", issuer: "http://www.okta.com/exk1", certificatePem: idp.certificatePem, }), googleSaml({ organizationId, ssoUrl: "https://accounts.google.com/o/saml2/idp?idpid=C01", entityId: "https://accounts.google.com/o/saml2?idpid=C01", certificatePem: idp.certificatePem, }), ]; for (const input of inputs) { const made = await sso.connections.create({ actor: APP, ...input }); if (!made.ok) throw new Error(`${made.code} ${made.message ?? ""}`); const id = made.value.id; expect(made.value.saml?.attributes).toEqual({ email: "email", name: null }); // The two values that each admin console asks for. expect(made.value.saml?.spEntityId).toBe(`${API}/auth/sso/${id}/metadata`); expect(made.value.saml?.acsUrl).toBe(`${API}/auth/sso/${id}/acs`); } });});How it behaves
Section titled “How it behaves”- Core verifies the Assertion with the certificate of the connection, never with a key of the document.
- A connection holds one or two certificates. When Okta makes a new certificate, add it to
certificates, activate it in Okta, then remove the old one. - Each address must be in a verified domain of the organization. A person of the Okta org with another address gets
sso_domain_mismatch. - Core refuses an encrypted assertion. Leave “Assertion Encryption” off.
If it fails
Section titled “If it fails”sso_failed: the log line names the step.exchangemeans a failed token request, for example by a method that the app does not take.audiencemeans a wrong “Audience URI (SP Entity ID)”.destinationorsubject_confirmationmeans a wrong “Single sign-on URL”.addressmeans no attributeemail.subjectmeans aNameIDthat is not persistent.sso_domain_mismatch: the attributeemailholds an address outside the verified domains.email_required: the ID token of an OIDC sign-in holds no address.sso_not_configured: the connection is off, or the config does not turn its kind on.invalid_body: the connection create refused a value. The message names the field.
The Okta pages
Section titled “The Okta pages”None of these pages shows a date of change.
| Page | Read (UTC) |
|---|---|
| Create OIDC app integrations | 2026-10-23 20:58 |
| Authorization servers | 2026-10-23 20:59 |
| Create SAML app integrations | 2026-10-23 20:58 |
| SAML field reference | 2026-10-23 20:59 |
| Define attribute statements | 2026-10-23 21:10 |
| Manage signing certificates | 2026-10-23 21:16 |