Skip to content

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.

  • 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.

  1. In the Admin Console, go to “Applications and Resources” > “Applications”.
  2. Select “Create App Integration”, then “OIDC - OpenID Connect”, then “Web Application”.
  3. Under “Grant type”, keep “Authorization code”.
  4. Under “Assignments”, pick the people or groups that may sign in.
  5. Save. Copy the “Client ID”.
  6. Under “Client authentication”, select “Client secret”, and copy the secret. Okta sends it by the method client_secret_basic. The field token_endpoint_auth_method of the Okta Apps API changes it.
  7. Create the connection with the Okta domain and the values of steps 5 and 6, as oktaOidc below does.
  8. 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, so oktaOidc below sets it.
  • client_secret_post: the secret goes in the body of the token request. It is the default of a connection. Pass it to oktaOidc for 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.

  1. Go to “Applications and Resources” > “Applications” > “Create App Integration”.
  2. Select “Classic experience”, then “SAML 2.0” as the sign-in method.
  3. Enter a name, then go on to the SAML settings.
  4. Enter a temporary https URL in “Single sign-on URL” and “Audience URI (SP Entity ID)”.
  5. Set “Name ID format” to the persistent format.
  6. Under “Attribute Statements”, add the name email, the format “Basic”, and the email address as the value.
  7. Finish the integration. On the “Sign On” tab, open “View SAML setup instructions”.
  8. Create the connection with the sign-in URL, the issuer, and the certificate there, as oktaSaml below does.
  9. Enter the acsUrl of the connection in “Single sign-on URL”.
  10. Keep “Use this for Recipient URL and Destination URL” selected.
  11. Enter the spEntityId of the connection in “Audience URI (SP Entity ID)”.
  12. 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.

The connection input of Okta
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 },
};
}
The connection of each provider as a test
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`);
}
});
});
  • 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.
  • sso_failed: the log line names the step. exchange means a failed token request, for example by a method that the app does not take. audience means a wrong “Audience URI (SP Entity ID)”. destination or subject_confirmation means a wrong “Single sign-on URL”. address means no attribute email. subject means a NameID that is not persistent.
  • sso_domain_mismatch: the attribute email holds 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.

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