-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
293 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#Examples for _steffo:meteor-accounts-saml_ | ||
|
||
There are currently two SAML IDPs supported by the examples. | ||
|
||
- ForgeRock's OpenAM (open-source, can be run locally) | ||
- Feide's OpenIDP (run as a service, free to register) | ||
|
||
### Step 1. Create a Meteor project | ||
|
||
First clone the GitHub project in your local filesystem. From your command line run | ||
|
||
``` | ||
$ meteor create openam | ||
$ cd openam | ||
``` | ||
|
||
After that, run | ||
|
||
``` | ||
$ cp -rp meteor-accounts-saml/openam-example/* . | ||
$ meteor add accounts-password | ||
$ meteor add accounts-ui | ||
$ meteor add steffo:meteor-accounts-saml | ||
``` | ||
|
||
Make sure that you add/change the user in `server/config.js` and that `initialBoot = true`in the same file. This will create a local Meteor user. | ||
|
||
### Step 2. Make sure that IDP and SP know each other | ||
|
||
The IDP configuration is reflected in the file `server/lib/settings.js`. Basically we only need to know the Login URL (`entryPoint`) and IDP's cert. Optionally, we can use the Single Logout URL. | ||
|
||
The SP configuration can be obtained by accessing eg `http://localhost:3000/_saml/metadata/forgerock` provided you have a SAML provider name `forgerock`in your `settings.js`. In OpenAM, you can create an SP configuration simply by pointing OpenAM to that Metadata URL. |
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Meteor.startup(function () { | ||
var initialBoot = true; | ||
// Change Fred Fredsen for your Google/OpenAM user | ||
|
||
|
||
var user = Meteor.users.findOne({ | ||
"emails.address": "[email protected]" | ||
}); | ||
if (initialBoot && !(user)) { | ||
console.log("Will create new root user - ENABLED. Please change code in config.js, Line 7"); | ||
Accounts.createUser({ | ||
email: "[email protected]", | ||
password: "password", | ||
username: "Fred Fredsen", | ||
profile: "" | ||
}); | ||
adminUser = Meteor.users.findOne({ | ||
"emails.address": "[email protected]" | ||
}); | ||
} | ||
|
||
|
||
for (i = 0; i < Meteor.settings.saml.length; i++) { | ||
// privateCert is weird name, I know. spCert is better one. Will need to refactor | ||
if (Meteor.settings.saml[i].privateKeyFile && Meteor.settings.saml[i].publicCertFile) { | ||
console.log("Set keys/certs for " + Meteor.settings.saml[i].provider); | ||
Meteor.settings.saml[i].privateCert = Assets.getText(Meteor.settings.saml[i].publicCertFile); | ||
Meteor.settings.saml[i].privateKey = Assets.getText(Meteor.settings.saml[i].privateKeyFile); | ||
} else { | ||
console.log("No keys/certs found for " + Meteor.settings.saml[i].provider); | ||
} | ||
} | ||
|
||
}); |
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
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