This repository is an example of an Authentication Action Plugin for the
Curity Identity Server, which uses the redirect()
response type. It consists
of two parts:
- the plugin code is in the
identityserver.plugins.authenticationactions.redirect-action
directory example
directory which contains a simple demo website to which the plugin action redirects. The demo is written in Java and Spring.
To run the example follow these steps:
- Start the project by running the command
mvn spring-boot:start
from theexample
directory. - Install the authentication plugin in your instance of the Curity Identity Server. Refer to the plugin's README to check how to do it.
- When the plugin is installed, go to the admin UI, then Authentication Profile -> Authenticators. Edit an authenticator of your choice.
- If you want to run the example with a local instance of the Spring application you'll need an HTTP client which uses
the
http
scheme. To add such client click theFacilities
button in the top right corner of the screen, scroll down to Http clients and click theNew
button. - Enter a suitable name for the client and click
Create
.
- Select the
http
scheme for the client and close the popup.
- Back in the authenticator form, in the action column click the
Add
button in either Login or SSO flow. - Click
New Action
, enter a suitable name and selectRedirect Action
type. - Enter the required configuration.
Enter the values from the above screen to run this example.
- Commit your changes. The action plugin is now ready.
You can test the action using OAuth.tools. Have a look at this tutorial to learn how to configure OAuth.tools with your instance of the Curity Identity Server. Once you have an environment configured, you can start any OAuth flow to initiate authentication. You can add a Debug Action to your authentication flow to check the parameters set by the redirect action.
To run the test suite locally, first ensure that you have an instance of the Curity Identity Server running with the plugin
installed and using the configuration found in tests/idsvr/config.xml
. Next, run the example app located in example
by using the Maven command mvn spring-boot:start
. Then, install Cypress by using the following commands.
cd tests
npm i
You can then open the Cypress app to run tests with npm run cypress.open
or run the headless version of the tests with
npm run cypress.run
.
To run the GitHub Actions workflow locally refer to this README.
Note that in order to run the workflow for this plugin you will need to run the Curity Identity Server directly in the
act
container, as described at the end of the linked README file.
Please visit curity.io for more information about the Curity Identity Server.