Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ For GitHub, follow these instructions (you need to be logged in in GitHub):
* Press the `Register application` button
* In the following page, on the top right corner, take note of the values for `Client ID` and `Client Secret`
* Now you need to copy the `Client ID` and `Client secret` in your jingo config file in the proper places
* Change `authorizationURL` `tokenURL` `userProfileURL` in the config file to your own url if you want to use github enterprise, or leave them empty for the default values: `authorizationURL: https://github.com/login/oauth/authorize` `authorizationURL: https://github.com/login/oauth/access_token` `userProfileURL: https://api.github.com/user`

The _local_ method uses an array of `username`, `passwordHash` and optionally an `email`. The password is hashed using a _non salted_ SHA-1 algorithm, which makes this method not the safest in the world but at least you don't have a clear text password in the config file. To generate the hash, use the `--hash-string` program option: once you get the hash, copy it in the config file.

Expand Down
3 changes: 3 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ module.exports = (function () {
enabled: false,
clientId: "replace me with the real value",
clientSecret: "replace me with the real value",
authorizationURL: "",
tokenURL: "",
userProfileURL: "",
redirectURL: ""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also the concern of people using the github authentication, updating Jingo after we merge this PR, not updating their config file, and then probably failing the authentication because the default values of those fields are not a valid value.

Copy link
Contributor Author

@everpcpc everpcpc May 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested an old config file without the new fields, enabled the github auth, It works well.

},
// @deprecated, use local with just an user
Expand Down
3 changes: 3 additions & 0 deletions routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ if (auth.github.enabled) {
passport.use(new passportGithub({
clientID: auth.github.clientId,
clientSecret: auth.github.clientSecret,
authorizationURL: auth.github.authorizationURL,
tokenURL: auth.github.tokenURL,
userProfileURL: auth.github.userProfileURL,
callbackURL: redirectURL
},
function (accessToken, refreshToken, profile, done) {
Expand Down