summaryrefslogtreecommitdiff
path: root/internal/handlers/const.go
AgeCommit message (Collapse)Author
2025-03-08refactor(handlers): add more detailed errors for password-change failures ↵Brynn Crowley
(#8899) Adds some more helpful log information to the change password feature. Signed-off-by: Brynn Crowley <littlehill723@gmail.com> Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com> Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
2025-03-06feat(web): change password (#7676)Brynn Crowley
Add the ability for users to change their password from their user settings, without requiring them to use the reset password workflow. User's are required to create a elevated session in order to change their password. Users may not change their password to their current password. The user's current password is required for the password change. Users must follow any established password policies. Administrators are able to turn this feature off. Closes #3548
2025-02-23feat(webauthn): passkeys (#7942)James Elliott
Add support for passkeys, granular attachment modality, granular authenticator selection, and authenticator filtering which is commonly used in an enterprise environment. This also adds metadata verification elements utilizing the MDS3 to the project, including saving attestation statements, verification of attestation statements, etc. This also makes a significant change to the authentication level logic to purely use RFC8176 authentication method references to ensure the future-proof nature of the implementation. This change paves the way for the future of Authelia ensuring we can add custom policies in the future to allow administrators to very deliberately decide what authentication methods are sufficient for a given resource as well as the ability to clearly communicate these authentication methods to third parties via OpenID Connect 1.0 and SAML 2.0. It should be noted that at the time of this commit Passkey authentication is considered a single factor and we will at a later stage add the customizable policies described here to handle other use cases, though we've included a flag that considers properly implemented passkeys as if they were MFA. Closes #2827, Closes #2761 Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-03-04refactor: apply suggestions from code reviewJames Elliott
Per our standard review process this adjusts the appropriate elements detected during the review. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-03-04build(deps): use go.uber.org/mockJames Elliott
Use the new go.uber.org/mock which is currently maintained. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-03-04test(suites): add and fix tests for coverageJames Elliott
Add tests and adjust tests and code as appropriate. This also ensures we have thorough coverage of the code. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-03-04refactor: misc fixesJames Elliott
This implements misc fixes as part of one of our betas. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-03-04feat(web): one-time codes for identity verificationJames Elliott
This replaces the JWT method for Identity Verification for most elements with a One-Time Code which has a controllable lifetime. These codes elevate the session for a duration, are less likely to be accidentally clicked, can be revoked, and generally a better experience for users. Users will be able to copy the codes directly from the email or manually type them. This improves the process as the user is very unlikely to input the code into the wrong window, and can't open it in the wrong browser. In addition the process prevents accidental clicking from causing issues. Closes #3801 Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-03-04feat(web): user one-time password preferencesJames Elliott
This allows administrators to configure a list of Time-based One-Time Password parameters that users can pick from the web UI during registrations. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2024-03-04feat(web): multiple webauthn credential registrationJames Elliott
This implements multiple WebAuthn Credential registrations by means of a generic user settings UI. Closes #275, Closes #4366 Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com> Co-authored-by: Clément Michaud <clement.michaud34@gmail.com> Co-authored-by: Stephen Kent <smkent@smkent.net> Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
2024-01-07refactor(oidc): add pre-configured consent logs (#6512)James Elliott
This improves the pre-configured consent logging adding the audience and logging each failed match. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2023-12-25fix(oidc): par context redirect (#6450)James Elliott
This fixes an issue where the PAR context redirect contained more parameters than required. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2023-04-15refactor: webauthn naming (#5243)James Elliott
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2023-04-08feat(handlers): authz authrequest authelia url (#5181)James Elliott
This adjusts the AuthRequest Authz implementation behave similarly to the other implementations in as much as Authelia can return the relevant redirection to the proxy and the proxy just utilizes it if possible. In addition it swaps the HAProxy examples over to the ForwardAuth implementation as that's now supported. Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
2023-01-25feat(server): customizable authz endpoints (#4296)James Elliott
This allows users to customize the authz endpoints. Closes #2753, Fixes #3716 Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
2023-01-12feat(session): multiple session cookie domains (#3754)Manuel Nuñez
This adds support to configure multiple session cookie domains. Closes #1198 Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com> Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
2022-10-20feat(oidc): implicit consent (#4080)James Elliott
This adds multiple consent modes to OpenID Connect clients. Specifically it allows configuration of a new consent mode called implicit which never asks for user consent.
2022-07-26fix(handlers): consent session prevents standard flow (#3668)James Elliott
This fixes an issue where consent sessions prevent the standard workflow.
2022-07-11fix(web): offline_access consent description (#3679)James Elliott
2022-07-08refactor(middlewares): factorize responses (#3628)James Elliott
2022-06-14feat(metrics): implement prometheus metrics (#3234)James Elliott
Adds ability to record metrics and gather them for Prometheus.
2022-04-07feat(oidc): provide cors config including options handlers (#3005)James Elliott
This adjusts the CORS headers appropriately for OpenID Connect. This includes responding to OPTIONS requests appropriately. Currently this is only configured to operate when the Origin scheme is HTTPS; but can easily be expanded in the future to include additional Origins.
2022-04-03feat(authentication): password policy (#2723)Manuel Nuñez
Implement a password policy with visual feedback in the web portal. Co-authored-by: Manuel Nuñez <@mind-ar> Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
2022-03-04feat(oidc): oauth2 discovery support (#2925)James Elliott
* feat(oidc): oauth2 discovery and endpoint rename This implements the oauth2 authorization server discovery document, adds tests to the discovery documents, implements an efficiency upgrade to these docs, and renames some endpoints to be uniform.
2022-03-03feat: webauthn (#2707)James Elliott
This implements Webauthn. Old devices can be used to authenticate via the appid compatibility layer which should be automatic. New devices will be registered via Webauthn, and devices which do not support FIDO2 will no longer be able to be registered. At this time it does not fully support multiple devices (backend does, frontend doesn't allow registration of additional devices). Does not support passwordless.
2022-03-02refactor(configuration): utilize time duration decode hook (#2938)James Elliott
This enhances the existing time.Duration parser to allow multiple units, and implements a decode hook which can be used by koanf to decode string/integers into time.Durations as applicable.
2022-01-21fix(middlewares): smart delay on reset password (#2767)James Elliott
This adds a smart delay on reset password attempts to prevent username enumeration. Additionally utilizes crypto rand instead of math rand. It also moves the timing delay functionality into its own handler func.
2021-12-02refactor(handlers): utilize referer for auth logging rm/rd (#2655)James Elliott
This utilizes the referrer query parameters instead of current request query parameters for logging the requested URI and method. Minor performance improvements to header peek/sets.
2021-12-01feat(totp): algorithm and digits config (#2634)James Elliott
Allow users to configure the TOTP Algorithm and Digits. This should be used with caution as many TOTP applications do not support it. Some will also fail to notify the user that there is an issue. i.e. if the algorithm in the QR code is sha512, they continue to generate one time passwords with sha1. In addition this drastically refactors TOTP in general to be more user friendly by not forcing them to register a new device if the administrator changes the period (or algorithm). Fixes #1226.
2021-12-01feat(duo): multi device selection (#2137)Philipp Staiger
Allow users to select and save the preferred duo device and method, depending on availability in the duo account. A default enrollment URL is provided and adjusted if returned by the duo API. This allows auto-enrollment if enabled by the administrator. Closes #594. Closes #1039.
2021-11-29feat(regulator): enhance authentication logs (#2622)James Elliott
This adds additional logging to the authentication logs such as type, remote IP, request method, redirect URL, and if the attempt was done during a ban. This also means we log attempts that occur when the attempt was blocked by the regulator for record keeping purposes, as well as record 2FA attempts which can be used to inform admins and later to regulate based on other factors. Fixes #116, Fixes #1293.
2021-11-23feat(storage): primary key for all tables and general qol refactoring (#2431)James Elliott
This is a massive overhaul to the SQL Storage for Authelia. It facilitates a whole heap of utility commands to help manage the database, primary keys, ensures all database requests use a context for cancellations, and paves the way for a few other PR's which improve the database. Fixes #1337
2021-08-10fix: oidc issuer path and strip path middleware (#2272)Amir Zarrinkafsh
* fix: oidc issuer path and strip path middleware This ensures the server.path requests append the base_url to the oidc well-known issuer information and adjusts server.path configuration to only strip the configured path instead of the first level entirely regardless of its content. * fix: only log the token error and general refactoring * refactor: factorize base_url functions * refactor(server): include all paths in startup logging * refactor: factorize * refactor: GetExternalRootURL -> ExternalRootURL Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
2021-08-02fix(handlers): make user banned message consistent (#2223)James Elliott
This is so the user banned API message is consistent with other authentication failed messages, even in the API.
2021-07-22fix(handlers): handle xhr requests to /api/verify with 401 (#2189)James Elliott
This changes the way XML HTTP requests are handled on the verify endpoint so that they are redirected using a 401 instead of a 302/303.
2021-07-10feat(oidc): userinfo endpoint (#2146)James Elliott
This is a required endpoint for OIDC and is one we missed in our initial implementation. Also adds some rudamentary documentaiton about the implemented endpoints.
2021-07-04feat(oidc): add additional config options, accurate token times, and ↵James Elliott
refactoring (#1991) * This gives admins more control over their OIDC installation exposing options that had defaults before. Things like lifespans for authorize codes, access tokens, id tokens, refresh tokens, a option to enable the debug client messages, minimum parameter entropy. It also allows admins to configure the response modes. * Additionally this records specific values about a users session indicating when they performed a specific authz factor so this is represented in the token accurately. * Lastly we also implemented a OIDC key manager which calculates the kid for jwk's using the SHA1 digest instead of being static, or more specifically the first 7 chars. As per https://datatracker.ietf.org/doc/html/draft-ietf-jose-json-web-key#section-8.1.1 the kid should not exceed 8 chars. While it's allowed to exceed 8 chars, it must only be done so with a compelling reason, which we do not have.
2021-06-16feat(handlers): synology password complexity err on reset (#2083)James Elliott
This responds to the client with the correct error when used with Synology LDAP servers.
2021-05-05feature(oidc): add support for OpenID ConnectJames Elliott
OpenID connect has become a standard when it comes to authentication and in order to fix a security concern around forwarding authentication and authorization information it has been decided to add support for it. This feature is in beta version and only enabled when there is a configuration for it. Before enabling it in production, please consider that it's in beta with potential bugs and that there are several production critical features still missing such as all OIDC related data is stored in configuration or memory. This means you are potentially going to experience issues with HA deployments, or when restarting a single instance specifically related to OIDC. We are still working on adding the remaining set of features before making it GA as soon as possible. Related to #189 Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
2021-02-24feat(handlers): authorization header switch via query param to /api/verify ↵ThinkChaos
(#1563) * [FEATURE] Add auth query param to /api/verify (#1353) When `/api/verify` is called with `?auth=basic`, use the standard Authorization header instead of Proxy-Authorization. * [FIX] Better basic auth error reporting * [FIX] Return 401 when using basic auth instead of redirecting * [TESTS] Add tests for auth=basic query param * [DOCS] Mention auth=basic argument and provide nginx example * docs: add/adjust basic auth query arg docs for proxies Co-authored-by: Amir Zarrinkafsh <nightah@me.com>
2020-12-16[MISC] Catch OpenLDAP ppolicy error (#1508)Amir Zarrinkafsh
* [MISC] Catch OpenLDAP ppolicy error Further to the discussion over at #361, this change now ensures that OpenLDAP password complexity errors are caught and appropriately handled. This change also includes the PasswordComplexity test suite in the LDAP integration suite. This is because a ppolicy has been setup and enforced. * Remove password history for integration tests * Adjust max failures due to regulation trigger * Fix error handling for password resets * Refactor and include code suggestions
2020-12-02[FEATURE] Add Optional Check for Session Username on VerifyGet (#1427)James Elliott
* Adding the Session-Username header to the /api/verify endpoint when using cookie auth will check the value stored in the session store for the username and the header value are the same. * use strings.EqualFold to compare case insensitively * add docs * add unit tests * invalidate session if it is theoretically hijacked and log it as a warning (can only be determined if the header doesn't match the cookie) * add example PAM script * go mod tidy * go mod bump to 1.15
2020-11-27[FEATURE] Support MSAD password reset via unicodePwd attribute (#1460)Amir Zarrinkafsh
* Added `ActiveDirectory` suite for integration tests with Samba AD * Updated documentation * Minor styling refactor to suites * Clean up LDAP user provisioning * Fix Authelia home splash to reference correct link for webmail * Add notification message for password complexity errors * Add password complexity integration test * Rename implementation default from rfc to custom * add specific defaults for LDAP (activedirectory implementation) * add docs to show the new defaults * add docs explaining the importance of users filter * add tests * update instances of LDAP implementation names to use the new consts where applicable * made the 'custom' case in the UpdatePassword method for the implementation switch the default case instead * update config examples due to the new defaults * apply changes from code review * replace schema default name from MSAD to ActiveDirectory for consistency * fix missing default for username_attribute * replace test raising on empty username attribute with not raising on empty Co-authored-by: James Elliott <james-d-elliott@users.noreply.github.com>
2020-10-26[FEATURE] Add Remote-Name and Remote-Email headers (#1402)Amir Zarrinkafsh
2020-05-21[FEATURE] Delay 1FA Authentication (#993)James Elliott
* adaptively delay 1FA by the actual execution time of authentication * should grow and shrink over time as successful attempts are made * uses the average of the last 10 successful attempts to calculate * starts at an average of 1000ms * minimum is 250ms * a random delay is added to the largest of avg or minimum * the random delay is between 0ms and 85ms * bump LDAP suite to 80s timeout * bump regulation scenario to 45s * add mutex locking * amend logging * add docs * add tests Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-05-16[DEPRECATE] Remove Google Analytics (#1021)James Elliott
* it doesn't work with our current CSP * it's probably not used by anyone * it isn't in harmony with our security purposes * literally removes all use of it * suggestions from code review * remove useless test. Co-authored-by: Amir Zarrinkafsh <nightah@me.com> Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
2020-05-02[CI] Add goconst linter (#961)Amir Zarrinkafsh
* [CI] Add goconst linter * Implement goconst recommendations * Rename defaultPolicy to denyPolicy * Change order for test constants Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-04-20[MISC] Implement golint recommendations (#885)Amir Zarrinkafsh
Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-04-11[BUGFIX] Password hashing schema map mismatch with docs (#852)James Elliott
* add a nolint for gosec 'possibly hardcoded password' that was incorrect * make all parameters consistent * update the docs for the correct key name 'password' instead of 'password_options' or 'password_hashing' * reword some of the docs * apply suggestions from code review Co-Authored-By: Amir Zarrinkafsh <nightah@me.com>
2020-04-09[Buildkite] Introduce CI linting with golangci-lint and reviewdog (#832)Amir Zarrinkafsh
* [Buildkite] Introduce CI linting with golangci-lint and reviewdog * Initial pass of golangci-lint * Add gosimple (megacheck) recommendations * Add golint recommendations * [BUGFIX] Migrate authentication traces from v3 mongodb * Add deadcode recommendations * [BUGFIX] Fix ShortTimeouts suite when run in dev workflow * Add unused recommendations * Add unparam recommendations * Disable linting on unfixable errors instead of skipping files * Adjust nolint notation for unparam * Fix ineffectual assignment to err raised by linter. * Export environment variable in agent hook * Add ineffassign recommendations * Add staticcheck recommendations * Add gocyclo recommendations * Adjust ineffassign recommendations Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>