Integrating Crowd with Spring Security
The content on this page relates to platforms which are not supported for Crowd. Consequently, Atlassian can not guarantee providing any support for the steps described on this page. Please be aware that this material is provided for your information only and that you use it at your own risk.
Crowd provides a Spring Security connector for authentication and single sign-on. The connector uses Crowd's REST client to authenticate users and retrieve their group memberships.
Configure the application in Crowd
- Add the application to Crowd and configure its application credentials and permitted remote addresses.
- Map the directories the application can access.
- Configure which groups can authenticate with the application.
New application-directory mappings use read-only permissions by default. Existing mappings are unchanged.
Add the connector
The Crowd 8.0 connector uses Spring Security 7 and Jakarta Servlet APIs. Its Maven coordinates are:
<dependency>
<groupId>com.atlassian.crowd</groupId>
<artifactId>crowd-integration-springsecurity</artifactId>
<version>8.0.0</version>
</dependency>
The connector depends on crowd-integration-client-rest and crowd-integration-springsecurity-common. The servlet API dependency is provided by the application environment.
Configure the Crowd client
The client configuration includes:
| Property | Purpose |
|---|---|
application.name |
The application name configured in Crowd. |
application.password |
The application's authentication password. |
crowd.server.url |
The Crowd services URL, for example https://crowd.example.com/crowd/services/. |
crowd.base.url |
The Crowd base URL, for example https://crowd.example.com/crowd/. |
session.validationinterval |
The interval between revalidations of a Crowd session. |
cookie.tokenkey |
The name of the Crowd SSO token cookie. |
Connector components
com.atlassian.crowd.integration.springsecurity.RemoteCrowdAuthenticationProviderdelegates authentication to Crowd. Its constructor takes aCrowdClient,CrowdHttpAuthenticatorandCrowdUserDetailsService.com.atlassian.crowd.integration.springsecurity.user.CrowdUserDetailsServiceImplretrieves user details and group memberships throughCrowdClient. It supports mapping Crowd groups to Spring Security authorities.com.atlassian.crowd.integration.springsecurity.CrowdSSOAuthenticationProcessingFilterhandles Crowd SSO authentication. Its constructor takes aCrowdHttpTokenHelper,CrowdClientandClientProperties; itshttpAuthenticatorproperty supplies theCrowdHttpAuthenticator.
The application configures these components in its Spring Security authentication and filter configuration. A dependency declaration alone does not configure the authentication flow.
For Spring Security configuration, see the Spring Security reference.