Custom Authenticator¶
Is There A Simple Example Project?¶
Yes, you can checkout out the strongbox-authentication-example project.
What Dependencies Do I Need?¶
In your project you will need to add the following dependency:
<dependencies>
<dependency>
<groupId>org.carlspring.strongbox</groupId>
<artifactId>strongbox-authentication-api</artifactId>
<version>${version.strongbox}</version>
</dependency>
</dependencies>
What Do I Need To Implement?¶
-
Create an implementation of AuthenticationProvider. The purpose of this class is to process a specific Authentication implementation and return a fully authenticated object including credentials. You can find a simple example of this in the EmptyAuthenticationProviderComponent.
-
Create an implementation of Authenticator. This is the core API interface that delivers AuthenticationProvider and a name used for recognition. You can find a simple example of this in the [EmptyAuthenticator].
My Implementation Is Ready, Now What?¶
-
Build your code:
mvn clean package
-
Copy the produced
jar
file to thestrongbox/webapp/WEB-INF/lib
directory under your Strongbox distribution.
Final Notes¶
- Please remember that Authenticator implementations have to be Spring
@Components
. They are scanned by the Spring mechanisms to load fresh Application Context in the start time, or in the runtime (on reload request). - There are already a large number of existing AuthenticationProvider implementations for various needs, which are ready for use.
See Also¶
- Strongbox Authentication Example
- [The strongboxâauthenticationâproviders.xml File]
- Spring JavaDocs: AuthenticationProvider
TODO: fix links