https://github.com/fredex42/adfs-test
test for pac4j integration on Play/Scala
https://github.com/fredex42/adfs-test
Last synced: 3 months ago
JSON representation
test for pac4j integration on Play/Scala
- Host: GitHub
- URL: https://github.com/fredex42/adfs-test
- Owner: fredex42
- Created: 2020-05-01T12:47:12.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T13:07:23.000Z (almost 5 years ago)
- Last Synced: 2025-01-02T06:21:44.905Z (5 months ago)
- Language: CSS
- Size: 232 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# adfs-test
A working proof-of-concept for ADFS/bearer token auth for Play against ADFS
## What it is
This is a testing ground for better understanding ADFS/SSO with regard to both frontend and backend services.
It's using a local filter and the nimbus library to authenticate bearer tokens## How to use it
So long as you have sbt installed, it's pretty simple to get the backend up and running. `sbt run` should do the trick.
All library dependencies are listed in `build.sbt`.There is a frontend, but in this implementation it is redundant. Still, if you want to build the frontend,
you need node.js>=12 and npm installed:
```$bash
cd frontend
npm i
npm run dev```
This will watch the files and rebuild as they are modified.
## How to set it up
This bearer-token-only implementation does not require any direct connection to the IdP (identity provider server).
It only requires the signing certificate that can be obtained from the identity provider together.1. Get the signing certificate from your IdP and paste its contents into application.conf under auth.signingCertPem.
Include the BEGIN CERTIFICATE lines and all of the line-breaks.
2. Set up your allowed_hosts in application.conf if you are using a reverse-proxy for development.
3. Kick it off either with your IDE or by running `sbt run`.
4. The backend will expect an authorization header in incoming requests of the form "Authorization: Bearer {jwt}" where
jwt is a signed json web token. The user's profile will be extracted from the claims section of the jwt.