summaryrefslogtreecommitdiff
path: root/lib/web/auth (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-02-15Linter: Fix all lint errorsPhilip Molares13-39/+41
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-11Fix SAML auth error loggingDavid Mehren1-1/+1
As stated in https://github.com/node-saml/passport-saml/blob/master/CHANGELOG.md#v200-2020-11-03 and the corresponding PR https://github.com/node-saml/passport-saml/pull/412 passport-saml now always throws error objects instead of strings. This fixes our error logging to accommodate this change. Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-30Fix crash when OAuth2 config parameters are missingDavid Mehren1-12/+19
If the optional config options `config.oauth2.userProfileIdAttr` or `config.oauth2.rolesClaim` were not set, `String.split` was called on `undefined`, triggering a crash. This commit adds handling of these cases and improves error logging in `checkAuthorization`. Fixes #608 Signed-off-by: David Mehren <git@herrmehren.de>
2020-11-25Add oauth2 authorizationJoachim Mathes1-1/+22
Signed-off-by: Joachim Mathes <joachim_mathes@web.de>
2020-10-22Generic OAuth2: Set state: trueDexter Chua1-1/+2
The OAuth2 specification RECOMMENDS setting the state to protect against CSRF attacks. Some OAuth2 providers (e.g. ORY Hydra) refuse to authenticate without the state set. This is a cherry-pick of 852868419dc03d5dec79e75a3d7692ab670c927f. Signed-off-by: haslersn <sebastian.hasler@gmx.net>
2020-07-11saml: make logger print actual error messageSimeon Keske1-2/+2
Signed-off-by: Simeon Keske <git@n0emis.eu> Signed-off-by: Leo Maroni <git@em0lar.de>
2020-07-11add error handling to saml-certsSimeon Keske1-2/+15
Signed-off-by: Simeon Keske <git@n0emis.eu> Signed-off-by: Leo Maroni <git@em0lar.de>
2020-07-11allow to set a saml client certificateSimeon Keske1-0/+1
Signed-off-by: Simeon Keske <git@n0emis.eu>
2020-06-20Backport of #278 for 1.6.1Victor Berger1-1/+2
This is a backport of #278 with the default value of `scope` changed to `undefined`. This is thus a fully backward-compatible change. Signed-off-by: Victor Berger <victor.berger@m4x.org>
2020-02-08Add Google oauth variable: hostedDomainike1-1/+1
Which is part of `passport-google-oauth2`. It could be used as whitelist to a domain supported by google oauth. Ref: https://github.com/jaredhanson/passport-google-oauth2/issues/3 Signed-off-by: ike <developer@ikewat.com>
2019-11-28Removing returnTo setting from referer in all other authentication sourcesRalph Krimmel12-28/+8
Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-11-28Moving the storage of referrer information to main authorization check ↵Ralph Krimmel1-5/+3
instead of doing it in the authentication source Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-11-27Fixing linting problemsRalph Krimmel1-4/+3
Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-11-27Fixing redirection after SAML loginfoobarable1-2/+5
Saving referer into session in SAML auth so passport can redirect correctly after SAML login. Signed-off-by: Ralph Krimmel <rkrimme1@gwdg.de>
2019-10-27Move note actions to their own file.David Mehren2-8/+8
Because of circular import problems, this commit also moves the error messages from response.js to errors.js Signed-off-by: David Mehren <dmehren1@gmail.com>
2019-06-08Rework debug loggingSheogorath4-9/+8
We have various places with overly simple if statements that could be handled by our logging library. Also a lot of those logs are not marked as debug logs but as info logs, which can cause confusion during debugging. This patch removed unneeded if clauses around debug logging statements, reworks debug log messages towards ECMA templates and add some new logging statements which might be helpful in order to debug things like image uploads. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-05-31Fix eslint warningsSheogorath12-23/+23
Since we are about to release it's time to finally fix our linting. This patch basically runs eslint --fix and does some further manual fixes. Also it sets up eslint to fail on every warning on order to make warnings visable in the CI process. There should no functional change be introduced. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2019-05-13asyncified setting and verifying the passwordClaudius1-2/+8
Signed-off-by: Claudius <opensource@amenthes.de>
2019-04-06Added a configuration option for passport-saml:Emmanuel Ormancey1-1/+2
disableRequestedAuthnContext: true|false By default only Password authmethod is accepted, this option allows any other method. Issue and option described here: https://github.com/bergie/passport-saml/issues/226 Signed-off-by: Emmanuel Ormancey <emmanuel.ormancey@cern.ch>
2019-03-09Add required change for Google+ API deprecationSheogorath1-1/+2
Since Google+ is shutting down soon, we need to get the profile data from another URL. Since the library already supports it, all we need to do is adding a single line of code. Details: https://github.com/hackmdio/codimd/issues/1160 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-27Fix typoCloudYu2-4/+4
Signed-off-by: CloudYu <cloudyu322@gmail.com>
2018-11-14InternalOAuthError is not part of passport, but of passport-oauth2Claudius Coenen1-4/+4
This fixes part of #1056: an error while obtaining the profile would have `502`-crashed the server. Signed-off-by: Claudius Coenen <opensource@amenthes.de>
2018-10-05Add OpenID to CodiMDSheogorath2-0/+62
With OpenID every OpenID capable provider can provide authentication for users of a CodiMD instance. This means we have federated authentication. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-06-30Update passport-ldapSheogorath1-1/+1
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-04-27Fix typo of "grouptAttribute" in saml auth moduleMax Wu1-2/+2
Signed-off-by: Max Wu <jackymaxj@gmail.com>
2018-03-26Add support for generic OAuth2 providersPedro Ferreira2-0/+107
Signed-off-by: Pedro Ferreira <pedro.ferreira@cern.ch>
2018-03-25Change config to camel case with backwards compatibilitySheogorath11-35/+35
This refactors the configs a bit to now use camel case everywhere. This change should help to clean up the config interface and make it better understandable. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-18Add check for undefined UUIDSheogorath1-1/+8
This check is needed at there are tons of LDAP implementations out there and none has at least one guaranteed unique field. As we currently check three fields and added an option to select one yourself, it's still not said that any of these fields is set. This will now create an error and fail the authentication instead of letting people may get access to other people's notes which are stored under a this way deterministic wrong userid named `LDAP-undefined`. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-03-09Multiple emails from LDAP are already an ArrayFelix Schäfer1-1/+1
Signed-off-by: Felix Schäfer <felix@thegcat.net>
2018-03-01Introduce ldap.useridFieldDustin Frisch1-1/+4
Signed-off-by: Dustin Frisch <fooker@lab.sh>
2018-01-30Fix uncaught exception for non-existent userSheogorath1-0/+5
Since we added user management it's possible to get non-existent users which can cause a crash of the Backend server. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2017-12-09Add setting `ldap.usernameField`Lukas Kalbertodt1-1/+7
This determines which ldap field is used as the username on HackMD. By default, the "id" is used as username, too. The id is taken from the fields `uidNumber`, `uid` or `sAMAccountName`. To give the user more flexibility, they can now choose the field used for the username instead.
2017-12-04added guide for SAML settingsNorihito Nakae1-1/+0
2017-11-29fixed the SAML callback URL to unconfigurable.Norihito Nakae1-1/+1
2017-11-28Initial support for SAML authenticationNorihito Nakae2-0/+97
2017-10-31Add mattermost authenticationChristoph Witzany2-0/+50
2017-10-12Fix LDAP problem about missing uidNumberSheogorath1-2/+3
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2017-09-04Give google the correct name.Kaiyu Shi1-3/+3
2017-05-17fix: export to gist occurred 404 not foundMax Wu1-0/+4
2017-05-08refactor(config.js): Extract config fileBoHong Li1-8/+8
* Separate different config source to each files * Freeze config object
2017-05-08refactor(auth.js): Remove base pathBoHong Li1-8/+8
2017-05-08refactor(app.js): Move passport serialize and deserialize to auth moduleBoHong Li1-0/+22
2017-05-08refactor(app.js, auth.js): Extract all auth method to individual modulesBoHong Li10-0/+405