Single Sign-On with OKTA

This article explains configuring Single Sign-On (SSO) in CodeScan with Okta as your SAML 2.0 Identity Provider.

To allow users to log in via SAML SSO, CodeScan must be able to trust and rely on Okta to authenticate users wanting to log in. To establish this trust relationship, you must configure Okta and CodeScan so both parties can exchange authentication information.

When SSO is enabled, users and groups logging into CodeScan are redirected to the Okta login page. After successful authentication, they are redirected to the AutoRABIT Dashboard.

Who can use this feature

  1. Only Organization Admins can set up SAML SSO.

  2. You will need an existing Okta account to set up SAML SSO with Okta.

Step 1: Enabling Single Sign-On in CodeScan

Before configuring SSO in OKTA, you must enable SSO in CodeScan.

  1. In the Connection name field, enter the identity provider name as you want to appear (use only Latin characters without spaces and any special characters). Example- OKTA-SAML

  2. Enter a valid domain name of the organization in the Corporate domain field that can be authenticated in the Identity Provider. This property cannot be updated after SAML Connection creation. Example- In case of abc@autorabit.com, the corporate domain will be autorabit.com.

  3. Keep the Enforce SSO checkbox unchecked for now. You can enable Enforce SSO later when your domain has been confirmed. Once enabled, only SSO authentication will be allowed for email addresses of your corporate domain.

    Point to Note:

    1. Enforcing SSO affects both login and signup. Existing Auth0 users won't be able to login.

    2. Signup with email domain same as corporate domain won't be allowed.

    3. If the Enforce SSO is enabled prematurely, it will prevent all users in their organisation from accessing CodeScan. Consider enforcing SSO only after admins have logged in to CodeScan using SSO.

Step 2: Adding CodeScan as an App in OKTA

Set up the CodeScan application to provide necessary configuration information for CodeScan.

  1. Sign in to Okta. You must have the Applications Admin permission.

  2. If you don’t have an Okta organization, you can create a free Okta Developer Edition organization here: https://developer.okta.com/signup/

  3. Navigate to the Admin dashboard.

  4. In the Configure SAML tab, do the following:

    1. Single sign on URL: Enter the same URL in the below format: {instanceurl}/codescan/login/saml2/sso/{connection_id} For example: If your instance URL is https://app.codescan.io and the connection_id is OKTA-SAML, your SSO URL would be https://app.codescan.io/_codescan/login/saml2/sso/OKTA-SAML

Where can I find my Connection ID?

Your connection id will be available in the Metadata URL generated inside CodeScan.

For example: Metadata URL- https://app.codescan.io/_codescan/saml2/metadata/OKTA-SAML Connection Id: OKTA-SAML

  1. On the same screen, in the Attribute Statements panel, add the following attributes (mandatory) and map to corresponding OKTA properties:

NameName formatValue

saml_email

Unspecified

user.email

saml_username

Unspecified

user.login

saml_name

Unspecified

user.firstName

  1. Click Next to continue.

Step 3: Configuring SAML Connection in CodeScan

Once the application is created, you will need to enter the identity provider data from OKTA into CodeScan.

  1. In OKTA, go to the Sign On tab and navigate to the SAML Signing Certificates section.

  2. Open the downloaded certificate in Notepad. You will need to copy the content of the certificate into the X509 Signing Certificate field of CodeScan SAML connection [Step 7.c below].

  3. A new tab will open, which displays the IdP metadata file in XML format.

  4. Enter the following values:

    1. Provider Entity Id: Copy the entityID value and paste it into Provider Entity Id inside CodeScan.

  5. Click Update on the CodeScan page.

  6. The next step is to confirm your corporate domain to get the SSO working. You can confirm domain by raising a request via Codescan Support.

Step 4: Testing the Single Sign-On Configuration

  1. Enter the corporate domain name you have configured when enabling SSO inside CodeScan in the Your Company email field. For example- autorabit.com

  2. You should successfully redirect to the CodeScan Organization page after authentication.

Last updated