https://github.com/curityio/redirect-action-example
An example authentication action which redirect the user to an external system.
https://github.com/curityio/redirect-action-example
authentication-action plugin redirect
Last synced: about 2 months ago
JSON representation
An example authentication action which redirect the user to an external system.
- Host: GitHub
- URL: https://github.com/curityio/redirect-action-example
- Owner: curityio
- License: apache-2.0
- Created: 2020-06-18T13:39:46.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-11-07T08:34:31.000Z (7 months ago)
- Last Synced: 2025-01-30T13:29:07.544Z (4 months ago)
- Topics: authentication-action, plugin, redirect
- Language: Java
- Homepage: https://curity.io/resources/learn/redirect-action-example/
- Size: 534 KB
- Stars: 0
- Watchers: 5
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Redirect Action Example
[](https://curity.io/resources/code-examples/status/)
[](https://curity.io/resources/code-examples/status/)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.
## Running the exampleTo run the example follow these steps:
- Start the project by running the command `mvn spring-boot:start` from the `example` directory.
- Install the authentication plugin in your instance of the Curity Identity Server. Refer to the
[plugin's README](identityserver.plugins.authenticationactions.redirect-action/README.rst) 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 the `Facilities` button in the top right corner of the screen, scroll down
to **Http clients** and click the `New` 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 select `Redirect 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.
## Test with OAuth.tools
You can test the action using [OAuth.tools](https://oauth.tools). Have a look at
[this tutorial](https://curity.io/resources/learn/test-using-oauth-tools/) 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](https://curity.io/resources/videos/debug-action/) to your authentication flow
to check the parameters set by the redirect action.## Running Tests Locally with Cypress
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.```bash
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`.## Running the GitHub Actions Workflow Locally
To run the GitHub Actions workflow locally refer to this [README](https://github.com/curityio/github-actions-utilities).
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.## More Information
Please visit [curity.io](https://curity.io/) for more information about the Curity Identity Server.