Integrate with Cursor
Support level: Community
What is Cursor?
Cursor is an AI coding agent and code editor built to help developers write, edit, and understand code.
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.example.companyis the email domain that you verify in Cursor.
This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.
Cursor SSO requires a Cursor Team or Enterprise plan and admin access to the Cursor organization. Cursor also requires domain verification for the email domains that use SSO; domain verification is outside the scope of this integration guide.
authentik configuration
To support the integration of Cursor with authentik, you need to create SAML property mappings and an application/provider pair.
Create property mappings
Create SAML property mappings for the attributes that Cursor expects from the identity provider.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Customization > Property Mappings and click Create. Create the following SAML Provider Property Mapping entries:
- ID mapping:
- Name: choose a descriptive name.
- SAML Attribute Name:
id - Friendly Name: leave blank.
- Expression:
return str(request.user.uuid)
- Email mapping:
- Name: choose a descriptive name.
- SAML Attribute Name:
email - Friendly Name: leave blank.
- Expression:
return request.user.email
- First name mapping:
- Name: choose a descriptive name.
- SAML Attribute Name:
firstName - Friendly Name: leave blank.
- Expression:
return request.user.name.split(" ", 1)[0] if request.user.name else request.user.username
- Last name mapping:
- Name: choose a descriptive name.
- SAML Attribute Name:
lastName - Friendly Name: leave blank.
- Expression:
return request.user.name.rsplit(" ", 1)[-1] if " " in request.user.name else " "
- ID mapping:
Create an application and provider in authentik
authentik 2026.5 introduces changes to how the SAML provider behaves. Specifically, the provider now automatically sets the Issuer value to: https://authentik.company/application/saml/<application_slug>/metadata/
Older versions of authentik set this value to authentik by default. If you're running an older version, please set Issuer to https://authentik.company/application/saml/<application_slug>/metadata/, where <application_slug> is the slug that you selected for the application.
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
Navigate to Applications > Applications and click New Application to create an application and provider pair.
- Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Note the Slug value because it is required later.
- Choose a Provider type: select SAML Provider as the provider type.
- Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
- Temporarily set the ACS URL and Audience to
https://temp.temp. - Under Advanced protocol settings:
- Select an available Signing Certificate.
- Set NameID Property Mapping to
authentik default SAML Mapping: Email. - Add the property mappings that you created earlier.
- Temporarily set the ACS URL and Audience to
- Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
-
Click Submit to save the new application and provider.
Copy the metadata URL
- Navigate to Applications > Providers and click the name of the SAML provider that you created.
- Under Related objects > Metadata, click Copy download URL. This metadata URL is required in the Cursor setup flow.
Cursor configuration
- Log in to the Cursor dashboard settings as an organization administrator.
- Find and expand the Single Sign-On (SSO) section.
- Click SSO Provider Connection settings and follow the setup wizard.
- Create a new SAML connection and copy the following Cursor service provider values. These values are required in the next section:
- ACS URL
- SP Entity ID
- When Cursor asks for identity provider information, use the authentik metadata URL that you copied earlier.
- Configure the SAML attributes as follows:
idto the user ID field.emailto the email field.firstNameto the first name field.lastNameto the last name field.
- Keep the Cursor setup flow open.
Update the authentik provider
- Return to the authentik Admin interface.
- Navigate to Applications > Providers and open the SAML provider that you created earlier.
- Under Protocol settings, set the following values:
- ACS URL: set to the ACS URL value from Cursor.
- Audience: set to the SP Entity ID value from Cursor.
- Click Update to save the provider.
Test and enable SSO
- Return to the Cursor setup flow.
- Run the SSO test. Cursor should redirect you to authentik for authentication and then back to Cursor.
- After the test succeeds, complete the setup flow.
- Verify
example.companyfrom the Cursor Domain verification settings page if you have not already done so. - Configure SSO enforcement from the Cursor admin dashboard.
Configuration verification
To confirm that authentik is properly configured with Cursor, log out of Cursor and sign in with an email address from the verified SSO domain. You should be redirected to authentik and, after authenticating, returned to Cursor.