Configure Single Sign-On (SSO) for ArgoCD using OKTA

In this guide, we will explore how to configure Single Sign-On (SSO) for Argo CD using Okta. SSO enables users to securely authenticate with Argo CD through a centralized identity provider, simplifying access management and enhancing security. By integrating Okta, a leading identity and access management solution, with Argo CD, you can streamline user authentication and provide seamless access to your Kubernetes deployments.

Prerequisites

  • AWS Account with Ubuntu 24.04 LTS EC2 Instance.
  • Minikube and kubectl, Helm Installed.
  • Basic knowledge of Kubernetes and Okta.

What is Okta?

Okta is a leading identity and access management (IAM) platform that provides secure, reliable, and seamless authentication solutions for businesses of all sizes. It acts as a centralized identity provider (IdP) that manages user identities and access permissions across various applications and services. Okta offers features like Single Sign-On (SSO), multi-factor authentication (MFA), and directory integration, making it a popular choice for organizations looking to enhance their security and simplify user access management.

Why Use Okta?

There are other tools like Github and Gitlab but we are using Okta instead of GitHub or GitLab for authentication because Okta is a specialized identity and access management platform. While GitHub and GitLab are primarily source control and CI/CD tools with basic authentication capabilities, Okta provides advanced features like Single Sign-On (SSO), Multi-Factor Authentication (MFA), centralized user management, and seamless integration with a wide range of applications. This makes Okta more robust, secure, and scalable for managing access across multiple platforms in enterprise environments.

Why Integrate SSO with Argo CD?

Argo CD’s default authentication system involves creating and managing individual user accounts within its environment. While functional, this approach can quickly become a challenge for administrators as the number of users increases. The process of manually creating, updating, and managing user credentials is not only time-consuming but also prone to inefficiencies and errors.

By integrating Single Sign-On (SSO) with Argo CD using a robust identity provider like Okta, these challenges can be addressed effectively. SSO simplifies user access by enabling a single, unified login for all connected applications. This not only enhances security through centralized authentication policies but also streamlines administration by allowing administrators to manage user access from one central location.

For organizations already leveraging Okta, integrating it with Argo CD offers additional benefits. The seamless connection between platforms fosters a smoother user experience, reduces the need for redundant login credentials, and ensures that users can quickly access resources without compromising security. SSO, in essence, combines convenience, security, and efficiency, making it a smart choice for managing authentication in modern DevOps workflows.

Step #1:Setting Up Okta

Log in to your Okta admin dashboard.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 1

Navigate to Applications > Applications.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 2

Click on Create App Integration.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 3

Select SAML 2.0 as the sign-on method and click Next.

We use SAML 2.0 over OIDC, SWA, and API services because it is specifically designed for enterprise-grade Single Sign-On (SSO). SAML 2.0 enables robust integration with legacy systems, provides extensive security features, and supports rich attribute sharing between identity providers and applications. While OIDC is lightweight and ideal for modern apps, SAML excels in handling complex enterprise use cases. SWA and API services lack the scalability and security SAML offers for seamless authentication across multiple platforms.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 4

Configure SAML Integration. Provide a name like “ArgoCD“. You can add the App logo and in App visibility select both checkbox.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 5
  • Single Sign-On URL: Enter your Argo CD callback URL (e.g., https://<ARGO-CD-URL>/api/dex/callback).
  • Recipient URL: Use the same as the Single Sign-On URL.
  • Destination URL: Enter the same callback URL here.
  • Audience URI (SP Entity ID): Set this to the callback URL as well.

Here I have used my EC2 Instance Public IP Address and :8080 port.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 6

In Attribute Statements write Name: email, Name format : Basic and Value: user.email.

In Group Attribute Statements write Name: group, Name format : Basic and Filter: Matches regex .*

Configure Single Sign-On (SSO) for ArgoCD using OKTA 7

Click on Next.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 8

In Feedback, select first checkbox, This is an internal app that we have created and click on Finish.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 9
Configure Single Sign-On (SSO) for ArgoCD using OKTA 10

you will see the Sign On tab.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 11

Under the Assignments tab of your new application, assign users or groups who should have access to Argo CD.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 12

Select people to assign.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 13

click on Save and Go Back.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 14

you will see the assigned people.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 15

Go to the Sign On tab and and click on View SAML setup instructions.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 16

Here you will see the Single Sign-On URL and X.509 Certificate. Copy them for use in Argo CD.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 17

Step #2:Install and Configure ArgoCD

Create a new namespace called argocd in your Kubernetes cluster.

kubectl create namespace argocd
Configure Single Sign-On (SSO) for ArgoCD using OKTA 18

Install ArgoCD in the argocd namespace by applying the YAML file from the provided URL.

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Configure Single Sign-On (SSO) for ArgoCD using OKTA 19

List all the resources in the argocd namespace. It provides an overview of the ArgoCD setup includes Pods, Services, Deployments, ReplicaSets, and more.

kubectl -n argocd get all
Configure Single Sign-On (SSO) for ArgoCD using OKTA 20

Edit the service configuration of argocd-server.

kubectl -n argocd edit service argocd-server
Configure Single Sign-On (SSO) for ArgoCD using OKTA 21

modify it shown below. Change the type field from ClusterIP to NodePort. ClusterIP exposes the service only within the cluster. NodePort makes the service accessible externally via a specific port on the nodes.

type: NodePort
Configure Single Sign-On (SSO) for ArgoCD using OKTA 22

Run the kubectl -n argocd get all again to see if service type changed or not.

kubectl -n argocd get all
Configure Single Sign-On (SSO) for ArgoCD using OKTA 23

Create a okta.cert file.

nano okta.cert
Configure Single Sign-On (SSO) for ArgoCD using OKTA 24

add the X.509 certificate code which we cpoied.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 25

Save the file and exit.

now encode the ca file.

base64 okta.cert -w 0
Configure Single Sign-On (SSO) for ArgoCD using OKTA 26

Copy and store it.

Update the Argo CD ConfigMap to include SAML integration details.

kubectl -n argocd edit configmap argocd-cm
Configure Single Sign-On (SSO) for ArgoCD using OKTA 27

Modify it as shown below.

In the ssoURL give your copied url from okta. also give your redirect url and in caData paste the base64 encoded okta.cert file output.

apiVersion: v1
data:
  dex.config: |-
    connectors:
    - type: saml
      name: okta
      id: okta
      config:
        ssoURL: https://dev-XXXXXXXX.okta.com/app/dev-XXXXXXXX_argocd_4/exkmtvby7ve5F0J2a5d7/sso/saml
        redirectURI: https://13.61.193.64:8080/api/dex/callback
        usernameAttr: email
        emailAttr: email
        groupsAttr: group
        caData: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURxRENDQXBDZ0F3SUJBZ0lHQVpTTXFMRm1NQTBHQ1NxR1NJYjNEUUVCQ3dVQU1JR1VNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUcKQTFVRUNBd0tRMkZzYVdadmNtNXBZVEVXTUJRR0ExVUVCd3dOVTJGdUlFWnlZVzVqYVhOamJ6RU5NQXNHQTFVRUNnd0VUMnQwWVRFVQpNQklHQTFVRUN3d0xVMU5QVUhKdmRtbGtaWEl4RlRBVEJnTlZCQU1NREdSbGRpMDFNemczTURVMU1ERWNNQm9HQ1NxR1NJYjNEUUVKCkFSWU5hVzVtYjBCdmEzUmhMbU52YlRBZUZ3MHlOVEF4TWpJd05qRTJNek5hRncwek5UQXhNakl3TmpFM016TmFNSUdVTVFzd0NRWUQKVlFRR0V3SlZVekVUTUJFR0ExVUVDQXdLUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnd3TlUyRnVJRVp5WVc1amFYTmpiekVOTUFzRwpBMVVFQ2d3RVQydDBZVEVVTUJJR0ExVUVDd3dMVTFOUFVISnZkbWxrWlhJeEZUQVRCZ05WQkFNTURHUmxkaTAxTXpnM01EVTFNREVjCk1Cb0dDU3FHU0liM0RRRUpBUllOYVc1bWIwQnZhM1JoTG1OdmJUQ0NBU0l3RFFZSktvWklodmNOQVFFQkJRQURnZ0VQQURDQ0FRb0MKZ2dFQkFLb0grbGhqaHZoUlErb25jWmhlT01kTWdsUXZDVGUrWGg5NE9BamRMSDFvK2JiM2tXTytoYVFHc0tyajViR2J3QlFBZHF2SQp2Z01tVEZnYkQ5WmNQYVZwdEFSZXF4Uk9GbXp5YzdKSnpGSUdZOTg4QW53ZnhJWThVb3RhZjRUREYwQlQ4TXEzQkw2Rk54Tmt6WEFnClV4MTBNTXluTXltODdIc0VONVNQckhOcThyZTVBYWJJUWRwaTUxQTczQy9sbThkcTRWYmtnU3VwTUUrcnlFd3dXbnBFd1NMSlFCVkQKZ3NuekhITDJqVjcxWmxwRklDdm1pNTl0QTJLZHNRdXFTWXRFV2xvWXl5UnZra0NPaGhMUTBsdFdST3c5UzRmckZtd0crZHVsWE9sZgoxREhwcVAxM1k3c1QrMVN3dlhRR1U5MldWRzJhV0VxUm5XNXlBeGduU0JjQ0F3RUFBVEFOQmdrcWhraUc5dzBCQVFzRkFBT0NBUUVBCmxNTG5KczVQbmVNTnl3ZlhmSlIvL2dhS1NMcUErQmNZV05KRHViaVE5cVN3Yk1IM3AxLzZqS3A2cUpkQVlGanQweWprNnJ4ZTJ2ZVYKcjd0blRoMldZbXRyMFpyWnhPeldvTXlaLzJMM1VaZk5tYS85RFc2ejd6VzFZZ093ZzdINWhSMWVIWUZEengrdTFpUlBMUTQwYXJCcAp1SWp3VHVzRVZ5QjhmSVByZEdnTW5pK3NNb21iaDFCVzJCcU9kZE1BaHUyVnh3aXIyODZDQmZodHBPZXU1WGFWMHBWamFtOFF0elg5CnIyUnJTcDlDK2E0WmQ5OFVMdnNEVUJ1anlURU5MaFdjSU5wSW5zcytpd3JWUnl4Y0FTMDREWUZ4cnZ4Sk9TMmpId3h6V1gxR2w2V2kKM3EyVzB6ZDdiQkV3UXJyalZKN2xwRFRSUXFOb1hxcDNZL0w4WWc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg=="
  url: https://13.61.193.64:8080
kind: ConfigMap
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"ConfigMap","metadata":{"annotations":{},"labels":{"app.kubernetes.io/name":"argocd-cm","app.kubernetes.io/part-of":"argocd"},"name":"argocd-cm","namespace":"argocd"}}
  creationTimestamp: "2025-01-22T06:37:34Z"
  labels:
    app.kubernetes.io/name: argocd-cm
    app.kubernetes.io/part-of: argocd
  name: argocd-cm
  namespace: argocd
  resourceVersion: "3546"
  uid: 3d5f2426-d993-40eb-8507-1d6f5c72fb18
Configure Single Sign-On (SSO) for ArgoCD using OKTA 28

save the file and exit.

Restart the Argo CD server to apply the changes.

kubectl -n argocd rollout restart deployment argocd-server
Configure Single Sign-On (SSO) for ArgoCD using OKTA 29

Run the kubectl port-forward command. It forwards traffic from your local machine (port 8080) to the argocd-server service’s port 80 in the Kubernetes cluster. –address 0.0.0.0 Ensures the service is accessible from any IP address, not just localhost.

kubectl port-forward -n argocd --address 0.0.0.0 svc/argocd-server 8080:80
Configure Single Sign-On (SSO) for ArgoCD using OKTA 30

Now open your web browser and run <EC2-Public-IP>:8080. Click on Proceed to ….. to go to the home page of ArgoCD.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 31

You’ll see the “LOG IN VIA OKTA” button on the login page.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 32

Now click the LOG IN VIA OKTA button. Once logged in, you’ll be redirected to the Argo CD dashboard.

Configure Single Sign-On (SSO) for ArgoCD using OKTA 33

With Okta SSO, your team now enjoys automatic authentication and direct access to Argo CD, eliminating the need for manual logins. By managing user assignments centrally in Okta, you ensure secure, streamlined, and user-friendly access to your Kubernetes resources.

Conclusion:

Integrating Okta SSO with Argo CD streamlines authentication, making it secure, efficient, and user-friendly. This setup not only enhances security by leveraging centralized authentication policies but also simplifies access management for administrators. By following these steps, you can ensure a smoother, more productive experience for your team while reducing the complexities of managing multiple user accounts.

With Okta SSO in place, Argo CD becomes a more scalable solution for organizations aiming to maintain strong security and efficient workflows in their DevOps pipelines.

Related Articles:

Decoupling CI from CD with ArgoCD Image Updater

Reference:

Okta-ArgoCD Official Page

Prasad Hole

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap