forked from FusionAuth/fusionauth-site
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change code descriptions to present tense
- Loading branch information
Showing
1 changed file
with
4 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,7 @@ Let's see how the website currently looks before configuring SAML. | |
docker run --platform=linux/amd64 --rm -v ".:/app" -w "/app" --name app --network faNetwork -p 3000:3000 node:23-alpine3.19 sh -c "npm run start" | ||
``` | ||
|
||
These commands will install the Node.js packages in `package.json` and run the Express.js web server on the same network as the FusionAuth server in the Docker file, `faNetwork`. | ||
These commands install the Node.js packages in `package.json` and run the Express.js web server on the same network as the FusionAuth server in the Docker file, `faNetwork`. | ||
|
||
- Browse to `http://localhost:3000`. | ||
- Log in to the Changebank website with `[email protected]` and `password`. | ||
|
@@ -329,7 +329,7 @@ Let's see how the website currently looks before configuring SAML. | |
docker run --platform=linux/amd64 --rm -v ".:/app" -w "/app" --name app --network faNetwork -p 3000:3000 node:23-alpine3.19 sh -c "npm run start" | ||
``` | ||
|
||
These commands will install the Node.js packages in `package.json` and run the Express.js web server on the same network as the FusionAuth server in the Docker file, `faNetwork`. | ||
These commands install the Node.js packages in `package.json` and run the Express.js web server on the same network as the FusionAuth server in the Docker file, `faNetwork`. | ||
|
||
- Browse to `http://localhost:3000`. | ||
- Log in to the Changebank website with `[email protected]` and `password`. | ||
|
@@ -448,9 +448,9 @@ You can now browse to `http://localhost:3000` and log in exactly the same way as | |
|
||
### Explanation Of The New Code | ||
|
||
SAML is more strict with security certificates than OAuth. You needed to copy the certificate from FusionAuth into your website in order for SAML to trust it. | ||
SAML is more strict with security certificates than OAuth. You need to copy the certificate from FusionAuth into your website in order for SAML to trust it. | ||
|
||
In the authentication JavaScript file, you added SAML as a strategy. Passport can use multiple strategies, so you didn't need to remove OAuth. Each strategy is identified by a different label, like `saml`. The `setupSaml` function sets some options to match the settings in the SAML data from FusionAuth. The function then instantiates the new Passport SAML strategy with two functions that handle the user profile returned from the identity provider. You can further process the user in these functions, for instance by saving the user to a database, but in this example you do nothing except say that you are done. Express.js session storage (`express-session`) is already being used to store the user profile in a cookie that is sent to the user's browser. | ||
In the authentication JavaScript file, you add SAML as a strategy. Passport can use multiple strategies, so you don't need to remove OAuth. Each strategy is identified by a different label, like `saml`. The `setupSaml` function sets some options to match the settings in the SAML data from FusionAuth. The function then instantiates the new Passport SAML strategy with two functions that handle the user profile returned from the identity provider. You can further process the user in these functions, for instance by saving the user to a database, but in this example you do nothing except say that you are done. Express.js session storage (`express-session`) is already being used to store the user profile in a cookie that is sent to the user's browser. | ||
|
||
The code changes to the routes file are minimal, barely changing what is in the Passport documentation. You comment out the OAuth login route (because in this example the customer wanted to switch entirely to SAML), you add a SAML login route to direct the user to FusionAuth, and you use a callback handler to direct the logged in user to their account. | ||
|
||
|