Single Sign-On with Azure
Overview
This step-by-step guide explains how to set up Single Sign-On in CodeScan with Microsoft Azure Active Directory (AD) as your SAML 2.0 Identity Provider (IdP).
When you integrate CodeScan with Azure AD, you can:
Control in Azure AD who has access to CodeScan
Enable your users to be automatically signed in to CodeScan with their Azure AD accounts
Manage your accounts in one central location - the Azure portal.
Prerequisites
To get started, you need the following items:
Microsoft Azure account with Azure AD Premium activated.
Administrator level access to CodeScan and Azure AD to configure SSO.
Enable Single sign-on in CodeScan.
Add CodeScan as a non-gallery application in Azure.
Instructions
Step 1: Enabling Single Sign-On in CodeScan
Before configuring SSO in Azure AD, you must enable SSO in CodeScan.
In CodeScan, click on the
Profile
icon on the right corner of the screen and select your organization (underMy Organizations
).
Go to
Administration > SAML Connections
.
Click on
Create Connection
.
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-AD-SAML
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 ofabc@autorabit.com,
the corporate domain will beautorabit.com.
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:
Enforcing SSO affects both login and signup. Existing Auth0 users won't be able to login.
Signup with email domain same as corporate domain won't be allowed.
If the
Enforce SSO
checkbox is enabled prematurely, it will prohibit all users in their organisation from accessing CodeScan. Consider enforcing SSO only after admins have logged in to CodeScan using SSO.
Keep the
SAML Connection status
checkbox asEnabled
and click onCreate
button.
You will be able to see the
Metadata URL
generated for your SSO configuration. Keep the current page open while you continue to add the CodeScan app to Azure AD.
Step 2: Configuring Azure
Log in to the Azure portal (https://portal.azure.com/). In the left-hand menu, click
Azure Active Directory > Enterprise applications
.
Select
All applications
under theManage
section.Click
+ New application
at the top of the screen.
On the next screen, click on the
+ Create your own application
button.
Enter the name of the app as
CODESCAN
and choose the third option i.e.,Integrate any other application you don't find in the gallery (Non-gallery)
. ClickCreate
.
Once the CodeScan application is created, click on
Single sign-on
under theManage
section.
On the
Select a Single sign-on method
dialog, selectSAML
mode to enable single sign-on.
On the
Set up Single Sign-On with SAML
page, click theEdit (pencil)
icon forBasic SAML Configuration
to edit the settings.
On the
Basic SAML Configuration
section, perform the following steps:In the
Identifier (Entity ID)
field, enter theconnection_id
in this field. Example:AD-SAML
In the
Reply URL
field, enter theURL
in the below format:{instanceurl}/_codescan/login/saml2/sso/{connection_id}
For example: If your instance URL ishttps://app.codescan.io
and the connection_id isAD-SAML,
your Reply URL would behttps://app.codescan.io/_codescan/login/saml2/sso/OKTA-SAML
Click
Save
and close the dialog box.
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/AD-SAML
Connection_Id- AD-SAML
Click the
Edit (pencil)
icon forAttributes & Claims
to edit the attributes settings.
On the
Attributes & Claims
section, delete the auto-generated claims available in theAdditional claims
section.
Next, click on
+ Add New Claim
.
In the
Manage Claim
page, fill in the below details:
Name | Source | Source Attribute |
---|---|---|
saml_email | Attribute | user.mail |
Click
Save
.Follow similar steps to add two more claims as mentioned in the below table:
Name | Source | Source Attribute |
---|---|---|
saml_username | Attribute | user.mail |
saml_name | Attribute | user.displayname |
Close the dialog box and navigate to
Users and groups
section. Click on+ Add user/group
button to assign users and groups to app-roles for the CodeScan application.Click on
Single sign-on
to navigate back to theSet up Single Sign-On with SAML
page.In the
SAML Certificate
section, findCertificate (Base64)
and selectDownload
to download the certificate and save it on your computer.Point to Note:
Open the above downloaded certificate into your Notepad++, you will need to copy and paste the certificate into the CodeScan application while carrying out SAML configuration.
In the
SAML Certificate
section, findFederation Metadata XML
and selectDownload
to download the certificate and save it on your computer.
Step 3: Configuring in CodeScan SAML Connection
Now that your Azure SSO implementation is set up, you’ll need to follow just a few more steps to configure SSO in your CodeScan account.
In CodeScan, on the
SAML
page, go toActions
and click onEdit
.
Open the
Federation Metadata XML
certificate that you have earlier downloaded from Azure in a new tab of your browser.In the
Edit SAML Connection
dialog box on CodeScan, enter the following values:Provider Entity Id
: Copy the entityID value from the Federation Metadata XML certificate and paste it intoProvider Entity Id
inside CodeScan.
Sign In URL
: Copy the SingleSignOnService Location value and paste it into theSign In URL
inside CodeScan.
Open the Certificate (Base64) that you have downloaded from Azure in your Notepad++, copy the entire content and paste into the
X509 Signing Certificate
field of the CodeScan SAML connection.
Click
Update
on the CodeScan page.The next step is to confirm your corporate domain to get the SSO working. You can confirm domain via raising a request to Codescan Support.
Step 4: Testing the Single Sign-On Configuration
Log out of the CodeScan Console, and then log back in using the
Log in with SAML2
option.Enter the corporate domain name you have configured when enabling SSO inside CodeScan in the
Your Company email
field. For example- autorabit.comYou should successfully redirect to the CodeScan
Organization
page after authentication.
Last updated