# Connect CAS IdP

# Obtain a CAS identity provider

You need to register an account with the CAS identity provider first and obtain relevant information about the CAS identity provider. This article takes Alibaba Cloud CAS IdP as an example.

Please activate Alibaba Cloud Identity Service first, then enter the Application Identity Management Console, find your instance, and click to enter the details page.

In the left menu, go to Applications> Add Application, select the second page, find "CAS (Standard)", and click "Add Application".

In the configuration window that pops up, ServerNames and TargetUrl can be filled in at will, and we can modify them after we finish configuring Authing. Select "Account Mapping" as the account association method. Finally click "Submit".

After creation, close the pop-up window.

Find the application you just created, click "Details", and then click "View Details", as shown below:

Record the contents of CAS Server URL Prefix and CAS validation URL Prefix in the application details. It will be filled in Authing later.

# Create CAS connection

We just applied for a CAS IdP in Alibaba Cloud, and then we need to create a CAS connection in Authing.

Go to Authing Console> Connect Identity Source> Enterprise Identity Source, find "Connect CAS Identity Source" below, and click the "Add" button.

Fill in a connection identifier, display the name, fill in the previously recorded CAS Server URL Prefix and CAS validation URL Prefix to the corresponding location, and finally click save, as shown in the following figure:

Find the CAS connection you just created, click the edit button, and record the connection ID.

# Configure CAS IdP

Now let's go back to Alibaba Cloud CAS application configuration and modify the two URLs that we filled in randomly before. Disable the application first, and then click "Modify Application".

Fill in https://core.authing.cn/api/v2/connection/cas/[application ID] into ServerNames and TargetUrl, click "Submit", and finally don't forget to open Application switch to enable the application.

At this point, the configuration process is complete, and then we test the connection.

# Test CAS connection

Go to Control Panel> Apps> App List, choose an app at will, and click "Experience".

On the login page, click "Log in with Alibaba Cloud CAS IdP".

In the login box that pops up, complete the authentication in Alibaba Cloud CAS IdP.

login successful.

After successful login, jump to the callback address and carry the code authorization code.

# Next you may need

Use authorization code in exchange for user information:

Use OIDC authorization