docs/operator-manual/user-management/okta.md
[!NOTE] Are you using this? Please contribute!
If you're using this IdP please consider contributing to this document.
A working Single Sign-On configuration using Okta via at least two methods was achieved using:
[!NOTE] Okta app group assignment
The Okta app's Group Attribute Statements regex will be used later to map Okta groups to Argo CD RBAC roles.
App Visibility because Dex doesn't support Provider-initiated login flows.View setup instructions after creating the application in Okta.
argocd-cm in the data.urldata:
url: https://argocd.example.com
argocd-cm configuration.
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- stanzas) through base64 encoding, for example, base64 my_cert.pem.dex container in the argocd-dex-server Deployment.argocd-cm and configure the data.dex.config section:dex.config: |
logger:
level: debug
format: json
connectors:
- type: saml
id: okta
name: Okta
config:
ssoURL: https://yourorganization.oktapreview.com/app/yourorganizationsandbox_appnamesaml_2/rghdr9s6hg98s9dse/sso/saml
# You need `caData` _OR_ `ca`, but not both.
caData: |
<CA cert passed through base64 encoding>
# You need `caData` _OR_ `ca`, but not both.
# Path to mount the secret to the dex container
ca: /path/to/ca.pem
redirectURI: https://ui.argocd.yourorganization.net/api/dex/callback
usernameAttr: email
emailAttr: email
groupsAttr: group
It is possible to setup Okta SSO with a private Argo CD installation, where the Okta callback URL is the only publicly exposed endpoint.
The settings are largely the same with a few changes in the Okta app configuration and the data.dex.config section of the argocd-cm ConfigMap.
Using this deployment model, the user connects to the private Argo CD UI and the Okta authentication flow seamlessly redirects back to the private UI URL.
Often this public endpoint is exposed through an Ingress object.
Single sign on URL field points to the public exposed endpoint, and all other URL fields point to the internal endpoint.data.dex.config section of the argocd-cm ConfigMap with the external endpoint reference.dex.config: |
logger:
level: debug
connectors:
- type: saml
id: okta
name: Okta
config:
ssoURL: https://yourorganization.oktapreview.com/app/yourorganizationsandbox_appnamesaml_2/rghdr9s6hg98s9dse/sso/saml
# You need `caData` _OR_ `ca`, but not both.
caData: |
<CA cert passed through base64 encoding>
# You need `caData` _OR_ `ca`, but not both.
# Path to mount the secret to the dex container
ca: /path/to/ca.pem
redirectURI: https://external.path.to.argocd.io/api/dex/callback
usernameAttr: email
emailAttr: email
groupsAttr: group
Argo CD is aware of user memberships of Okta groups that match the Group Attribute Statements regex.
The example above uses the argocd-* regex, so Argo CD would be aware of a group named argocd-admins.
Modify the argocd-rbac-cm ConfigMap to connect the argocd-admins Okta group to the builtin Argo CD admin role.
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-rbac-cm
data:
policy.csv: |
g, argocd-admins, role:admin
scopes: '[email,groups]'
[!WARNING] Okta groups for RBAC
If you want
groupsscope returned from Okta, you will need to enable API Access Management with Okta. This addon is free, and automatically enabled, on Okta developer edition. However, it's an optional add-on for production environments, with an additional associated cost.You may alternately add a "groups" scope and claim to the default authorization server, and then filter the claim in the Okta application configuration. It's not clear if this requires the Authorization Server add-on.
If this is not an option for you, use the SAML (with Dex) option above instead.
[!NOTE] These instructions and screenshots are of Okta version 2023.05.2 E. You can find the current version in the Okta website footer.
First, create the OIDC integration:
Okta Admin page, navigate to the Okta Applications at Applications > Applications.Create App Integration, and choose OIDC, and then Web Application in the resulting dialogues.
App Integration name and Logo - set these to suit your needs; they'll be displayed in the Okta catalogue.Sign-in redirect URLs: Add https://argocd.example.com/auth/callback; replacing argocd.example.com with your ArgoCD web interface URL.Sign-out redirect URIs: Add https://argocd.example.com; substituting the correct domain name as above.Client ID and the Client Secret from the newly created app; you will need these later.Next, create a custom Authorization server:
Okta Admin page, navigate to the Okta API Management at Security > API.Add Authorization Server, and assign it a name and a description. The Audience should match your ArgoCD URL - https://argocd.example.comScopes > Add Scope:
groups. Leave the rest of the options as default.
Claims > Add Claim:
groups.Include in token type to ID Token, Always.Value type to Groups.Regex: argocd-.*.Include in to groups (the scope you created above).
Access Policies > Add Policy. This policy will restrict how this authorization server is used.
default is a reasonable name for this rule.Back to Authorization Servers, and copy the Issuer URI. You will need this later.In order to login with the CLI argocd login https://argocd.example.com --sso, Okta requires a separate dedicated App Integration:
Create App Integration, and choose OIDC, and then Single-Page Application.App Integration name and Logo - set these to suit your needs; they'll be displayed in the Okta catalogue.Sign-in redirect URLs: Add http://localhost:8085/auth/callback.Sign-out redirect URIs: Add http://localhost:8085.Client ID from the newly created app; cliClientID: <Client ID> will be used in your argocd-cm ConfigMap.Access Policies:
Security > API.Authorization Server that was created previously.Access Policies > Edit Policy.App Integration by filling in the text box and clicking Update Policy.
If you haven't yet created Okta groups, and assigned them to the application integration, you should do that now:
Directory > GroupsAdd Group, and choose a meaningful name. It should match the regex or pattern you added to your custom group claim.Applications and assign the OIDC application integration you created to this group.Finally, configure ArgoCD itself. Edit the argocd-cm configmap:
url: https://argocd.example.com
oidc.config: |
name: Okta
# this is the authorization server URI
issuer: https://example.okta.com/oauth2/aus9abcdefgABCDEFGd7
clientID: 0oa9abcdefgh123AB5d7
cliClientID: gfedcba0987654321GEFDCBA # Optional if using the CLI for SSO
clientSecret: ABCDEFG1234567890abcdefg
requestedScopes: ["openid", "profile", "email", "groups"]
requestedIDTokenClaims: {"groups": {"essential": true}}
You may want to store the clientSecret in a Kubernetes secret; see how to deal with SSO secrets for more details.