Okta SSO for AlmaForge
Last verified: December 1, 2026
Connect AlmaForge to Okta with OpenID Connect (OIDC) and map Okta groups to AlmaForge roles. Users sign in with their Okta account and receive roles from their current group memberships.
This guide uses an Okta Custom Authorization Server to configure the
groups scope, claim, and access policy in one place. Okta's org authorization
server also supports a groups claim in ID tokens if your organization does not
have API Access Management. See
Okta's groups claim guide
and the generic OIDC setup for that path.
Prerequisites
AlmaForge cluster
Use a running cluster. If you already have an admin CLI profile, run this on your workstation and confirm the active profile points to your cluster.
alma statusIf Okta will be your first SSO connector, use the local admin identity on the Auth Service host to apply it. See Connect your first identity provider.
Have the public HTTPS address of the Proxy Service ready. You will use its hostname to build the Okta redirect URI.
Okta administrator
You need an Okta administrator account that can create OIDC applications, manage groups, and configure custom authorization servers. The built-in Super Admin role covers all required permissions.
Okta API Access Management
Custom authorization servers require Okta's API Access Management feature. Okta Integrator Free Plan organizations provide a preconfigured custom authorization server for testing. Production organizations need a plan with the API Access Management add-on.
Okta groups
Have at least one Okta group ready to map to AlmaForge roles. Okta emits group
names as strings (for example, almaforge-admins), not email addresses or
UUIDs. Group name matching in AlmaForge is exact and case-sensitive. Copy each
group name verbatim from Directory → Groups in Okta.
Use a direct member of a mapped group for the first sign-in test.
Network access from Auth Service hosts
The Auth Service uses your Okta domain to discover its OIDC configuration,
verify token signatures, and exchange authorization codes for tokens. Allow
outbound HTTPS (TCP port 443) from every Auth Service host to your Okta domain,
such as example.okta.com or your custom domain.
Run this check from each Auth Service host, replacing example.okta.com with
your Okta domain.
curl -sS --max-time 10 -o /dev/null \ -w "example.okta.com: HTTP %{http_code}\n" \ "https://example.okta.com/"An HTTP response confirms connectivity. If curl reports HTTP 000, check DNS,
firewall, proxy, or TLS settings before continuing.
Step 1. Configure Okta with Terraform
If you do not use Terraform, follow Okta Admin Console setup below instead.
Save
almaforge-okta-sso.tf in
a new private working directory. It creates the OIDC web application, custom
authorization server, groups scope and claim, access policy and rule, and the
almaforge-admins and almaforge-developers groups. It assigns both groups to
the application. Keep Terraform state, state backups, and exported secrets out
of source control.
Export your Okta API credentials, replace almaforge.example.com with your
public Proxy Service hostname, and apply:
umask 077export OKTA_ORG_NAME="example"export OKTA_BASE_URL="okta.com"export OKTA_API_TOKEN="<okta-api-token>"terraform initterraform apply -var='proxy_public_addr=almaforge.example.com'terraform output -raw issuer_urlterraform output -raw client_idterraform output -raw client_secret > okta-secret.txtContinue to Step 2 to install
okta-secret.txt and apply the connector manifest.
Step 1. Configure Okta in the Okta Admin Console
Use this section if you do not use Terraform. If you already provisioned Okta with Terraform above, skip to Step 2.
Step 1.1. Create the OIDC application
-
Sign in to the Okta Admin Console.
-
Open Applications → Applications and click Create App Integration.
-
Select OIDC - OpenID Connect as the Sign-in method and Web Application as the Application type, then click Next.

-
Set these fields.
- App integration name:
AlmaForge SSO - Grant type: Select Authorization Code.
- Sign-in redirect URIs: Enter
https://almaforge.example.com/api/v1/oidc/callback. Replacealmaforge.example.comwith your public Proxy Service hostname. Keephttps://, omit:443, and omit the trailing slash. - Sign-out redirect URIs: Optional. Leave blank or enter
https://almaforge.example.com/. - Controlled access: Select Limit access to selected groups and pick the Okta groups that should access AlmaForge rather than allowing everyone.

- App integration name:
-
Click Save.
-
On the application's General tab under Client Credentials, copy the Client ID and Client secret.
Anyone with the client secret can impersonate AlmaForge to Okta's OAuth endpoints. Store it in the same secret manager you use for production credentials. Do not commit it to Git.
Step 1.2. Create a custom authorization server
-
In the left sidebar, open Security → API.
-
On the Authorization Servers tab, click Add Authorization Server.
-
Set these fields.
- Name:
almaforge - Audience:
almaforge(Okta requires an audience value. AlmaForge verifies the ID tokenaudclaim againstclientID, so this value does not need to match anything in the connector.) - Description:
AlmaForge OIDC Authorization Server
- Name:
-
Click Save. Okta opens the new authorization server with five tabs across the top: Settings, Scopes, Claims, Access Policies, and Token Preview.
-
On the Settings tab, copy the Issuer URI (for example,
https://example.okta.com/oauth2/<auth-server-id>).
Step 1.3. Add the groups scope and claim
Scopes and claims are configured on the custom authorization server you
created in Step 1.2, not on the
OIDC application. If you navigated away, open Security → API → Authorization
Servers and click your almaforge authorization server.
-
Click the Scopes tab and click Add Scope.
-
Set Name to
groups, Display name toGroups, and Description toReturn Okta group memberships, then click Create. -
Click the Claims tab right next to Scopes and click Add Claim.
-
Set these fields.
- Name:
groups - Include in token type: ID Token and Always
- Value type: Groups
- Filter: Matches regex with
.*(or use Starts with to limit emitted groups to a prefix such asalmaforge-) - Include in: Any scope (or The following scopes →
groups)
- Name:
-
Click Create. Confirm that
groupsappears in the Claims table with Typeidand IncludedAlways.
Step 1.4. Add an access policy and rule
Still inside your almaforge custom authorization server (Security → API →
Authorization Servers → almaforge), add an access policy and rule. Custom
authorization servers do not ship with a default policy, so Okta will not issue
tokens until you add one.
-
Click the Access Policies tab right next to Claims and click Add Policy.

-
Set Name to
Default, select Assign to → The following clients, and pick theAlmaForge SSOapplication from Step 1.1. Click Create Policy. -
Inside the new policy, click Add Rule and set these fields.
- Rule Name:
Default - IF Grant type is: Authorization Code
- AND User is: Any user assigned the app
- AND Scopes requested: Any scopes (or The following scopes
including
openid,profile,email, andgroups)

- Rule Name:
-
Click Create Rule.
Without an explicit access policy and rule on the custom authorization server,
Okta returns access_denied at token exchange even though browser sign-in
appears to succeed.
Step 2. Apply the OIDCConnector
Store the client secret in a root-only file on each Auth Service host.
almad runs as root, so only root needs read access to the file.
sudo install -o root -g root -m 0600 /dev/stdin /etc/almaforge/okta-secret.txt <<'EOF'<client-secret-value>EOFIn a multi-node Auth Service cluster, every host needs an identical secret file at this exact path. The instance that handles a login reads the file locally. See High availability to prevent intermittent login failures.
Write a YAML file describing the connector. Set clientSecret to a
${file:PATH} reference so the Auth Service reads the secret from disk, and
map Okta group names to AlmaForge roles under claimsToRoles:
# Okta connector loading clientSecret from a local file.
apiVersion: almaforge.com/v1
kind: OIDCConnector
metadata:
name: okta
spec:
display: Okta
issuerURL: https://<okta-domain>/oauth2/<auth-server-id>
clientID: <okta-client-id>
clientSecret: ${file:/etc/almaforge/okta-secret.txt}
scope:
- openid
- profile
- email
- groups
# Use exact, case-sensitive Okta group names under value and list existing
# AlmaForge roles.
claimsToRoles:
- claim: groups
value: almaforge-admins
roles: [admin, access]
- claim: groups
value: almaforge-developers
roles: [access]
Replace:
<okta-domain>and<auth-server-id>with the Issuer URI from Step 1 (or Step 1.2).<okta-client-id>with the Client ID from Step 1 (or Step 1.1).- The path inside
${file:...}with the path where you installedokta-secret.txton every Auth Service host. - The
claimsToRolesentries with your Okta group names and AlmaForge roles. Matching is exact and case-sensitive.
spec.scope must include groups explicitly. Without it, Okta omits the
groups claim even when configured on the authorization server.
Alternative: load the client secret from an environment variable or inline
clientSecret also accepts an environment variable reference
(${env:OKTA_CLIENT_SECRET}) or an inline string. An inline value stores the
secret directly in the cluster state store, where it is returned by
alma get oidcconnector/okta -o yaml --with-secrets and included in
backend backups. Prefer ${file:PATH} or ${env:VAR} in production. See
Secret storage.
AlmaForge has no local accounts. If this is the only connector, a wrong claim mapping or expired client secret prevents new logins. Confirm your break-glass procedure works before applying the connector to a production cluster.
If you have a cluster admin profile, apply the connector from your workstation.
alma apply -f okta.yamlIf this is your first connector, copy okta.yaml to the Auth Service host and
apply it there using the local admin identity.
sudo alma apply -f okta.yamlStep 3. Verify the connector
Open the cluster's audit log for your test account. See SSO verification for event fields and the distinction from service logs.
Keep your admin session open. From a separate workstation or OS account, sign in as a direct member of a mapped Okta group. Replace the example proxy address with yours.
alma login --proxy=almaforge.example.comChoose Okta in the browser. The test passes when alma prints the
roles expected for that user.
If this is the cluster's first connector, also sign in with an account mapped to
admin. Confirm that alma prints the admin role before closing the
local admin session on the Auth Service host.
Audit events from a successful sign-in
A successful first-time login emits a UserLogin event and the
CertificateCreate event for the certificate it mints:
{
"kind": "AuditEvent",
"apiVersion": "almaforge.com/v1",
"spec": {
"id": "5a4b3c2d-1e0f-4958-8776-655443322110",
"index": 0,
"timestamp": "2026-03-30T15:58:58.999000Z",
"clusterName": "almaforge.example.com",
"code": "T1001I",
"type": "UserLogin",
"verb": "login",
"actor": {
"name": "alice@example.com",
"type": "user"
},
"status": {
"success": true
},
"userLogin": {
"method": "oidc",
"attributes": {
"connector_id": "okta",
"connector_type": "oidc",
"email": "alice@example.com",
"name": "Alice Example",
"request_id": "8f0c1e6a-2f7e-4a7a-9f1e-1f0b6d0f1a2b",
"username": "alice@example.com"
}
}
}
}
{
"kind": "AuditEvent",
"apiVersion": "almaforge.com/v1",
"spec": {
"id": "b1c2d3e4-f506-4718-8929-3a4b5c6d7e8f",
"index": 0,
"timestamp": "2026-03-30T15:58:58.999000Z",
"clusterName": "almaforge.example.com",
"code": "TC000I",
"type": "CertificateCreate",
"verb": "create",
"certificateCreate": {
"certType": "user",
"identity": {
"user": "alice@example.com",
"roles": [
"admin",
"access"
],
"logins": [
"tester",
"ec2-user",
"root"
],
"traits": {
"email": [
"alice@example.com"
],
"groups": [
"almaforge-admins",
"engineering"
],
"name": [
"Alice Example"
],
"preferred_username": [
"alice@example.com"
]
}
}
}
}
}
Check spec.certificateCreate.identity.traits.groups. It contains the exact
group names Okta emitted on the groups claim. If groups is missing or empty:
groupsis missing fromspec.scopeinokta.yaml.- The
groupsclaim is missing on the custom authorization server (Step 1.3), or its filter excludes the user's groups. - The user is not assigned to the OIDC application in Okta (Step 1.1).
Read the full audit-event breakdown on the generic OIDC verification section.
Troubleshooting
access_denied after the callback
Okta returned access_denied or invalid_grant at token exchange even though
browser sign-in appeared to succeed. Open your authorization server under
Security → API → Authorization Servers → Access Policies, confirm a policy
is assigned to AlmaForge SSO, and verify an active rule allows the
Authorization Code grant type
(Step 1.4).
No roles match the login
The login is rejected when no mapping assigns a role. Check these conditions first:
spec.scopeinokta.yamlincludesgroups.- Under Claims on the authorization server, the
groupsclaim is set to ID Token and Always. - Every
claimsToRolesvalue matches the Okta group name verbatim (exact and case-sensitive).
With ALMA_LOG_LEVEL=debug on the Auth Service host, sign in again and inspect
the claims Okta sent:
journalctl -u almad -f | grep 'Extracted claims'After a successful login, inspect
spec.certificateCreate.identity.traits.groups in the CertificateCreate
audit event. See Claims, traits, and role templates.
Invalid issuer URL
For the custom authorization server setup in this guide, set spec.issuerURL to
https://<okta-domain>/oauth2/<auth-server-id> from the authorization server's
Settings tab. The bare org URL (https://<okta-domain>) applies only to the
org-server alternative.
unauthorized_client
The clientID in okta.yaml does not match the OIDC application assigned to
the authorization server's access policy, or the user is not assigned to the
application. Confirm both in the Okta Admin Console and re-apply.
429 Too Many Requests
Okta enforces strict per-org rate limits on the token and userinfo endpoints. In a multi-node Auth Service cluster during a login spike, every Auth instance calls Okta independently. Monitor the Auth journal for HTTP 429 responses and contact Okta support for a rate-limit increase if legitimate login volume exceeds your limit.
Operations
Break-glass access
Test break-glass access before relying on this
connector. Okta-specific recovery cases include a deleted authorization server
or revoked access policy, alongside rotated client secrets and incorrect
claimsToRoles mappings.
Revocation
Removing a user from an Okta group takes effect on their next sign-in. Existing certificates remain valid until they expire. For an immediate cutoff, lock the user.
Secret storage
Use ${file:PATH} or ${env:VAR} to keep clientSecret out of the cluster
state store and its backups. Follow Secret storage
to protect secrets in production.
Client secret rotation
An Okta OIDC application can hold multiple active client secrets, so you can rotate one without downtime:
- In the Okta Admin Console, open your OIDC application's General tab and click Generate new secret under Client Credentials. Do not delete the old secret yet.
- Copy the new secret value.
- Replace
/etc/almaforge/okta-secret.txton every Auth Service host using your configuration management tool (Ansible, Puppet, cloud-init, or Kubernetes secret mounts). - Confirm a test login works through
alma login. - Delete the old secret in Okta.
The connector reads the file on the next login. No almad restart is
required. If you configured an inline clientSecret, re-apply the connector
with the new value.
Lifecycle
Apply connector changes before testing the next login. No almad
restart is needed. See
When connector changes take effect
for discovery caching and IdP-side changes.
High availability
AlmaForge reads /etc/almaforge/okta-secret.txt on the Auth Service instance
that handles each login callback. In a multi-node Auth Service cluster, a
missing or stale file on one instance causes intermittent login failures. Deploy
the file through configuration management so every Auth Service host has an
identical copy at the same path with mode 0600.
Every Auth Service instance also calls Okta independently and caches the OIDC discovery document for one hour. See High availability on the generic OIDC page for the full list of per-instance assumptions.
Monitoring
Monitor the audit log for login outcomes. For diagnostics, inspect the Auth journal for token validation and the Proxy journal for browser callbacks. On each service host, tail OIDC-related messages with:
journalctl -u almad -f | grep -Ei 'okta|oidc'Check UserLogin failures and their spec.status.error field. See
SSO verification for event codes,
certificate fields, and debug-only journal copies. Collect records from
audit event storage for SIEM ingestion.
Collect service diagnostics from the journal separately.
Removal
Delete the connector resource:
alma delete oidcconnector/oktaExisting sessions issued through the connector remain valid until their certificates expire. No new sessions will be issued.
On the Okta side, remove /etc/almaforge/okta-secret.txt from Auth Service
hosts and delete the OIDC application and custom authorization server. If other
AlmaForge clusters share the same authorization server, leave it in place.