aboutsummaryrefslogtreecommitdiffstats
path: root/templates/admin/auth/new.tmpl
Commit message (Collapse)AuthorAgeFilesLines
* Remove urls from translations (#31950)Denys Konovalov2024-09-021-10/+10
| | | | | | | Part of #27700 Removes all URLs from translation strings to easy up changing them in the future and to exclude people injecting malicious URLs through translations. First measure as long as #24402 is out of scope.
* allow synchronizing user status from OAuth2 login providers (#31572)Rowan Bohde2024-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This leverages the existing `sync_external_users` cron job to synchronize the `IsActive` flag on users who use an OAuth2 provider set to synchronize. This synchronization is done by checking for expired access tokens, and using the stored refresh token to request a new access token. If the response back from the OAuth2 provider is the `invalid_grant` error code, the user is marked as inactive. However, the user is able to reactivate their account by logging in the web browser through their OAuth2 flow. Also changed to support this is that a linked `ExternalLoginUser` is always created upon a login or signup via OAuth2. ### Notes on updating permissions Ideally, we would also refresh permissions from the configured OAuth provider (e.g., admin, restricted and group mappings) to match the implementation of LDAP. However, the OAuth library used for this `goth`, doesn't seem to support issuing a session via refresh tokens. The interface provides a [`RefreshToken` method](https://github.com/markbates/goth/blob/master/provider.go#L20), but the returned `oauth.Token` doesn't implement the `goth.Session` we would need to call `FetchUser`. Due to specific implementations, we would need to build a compatibility function for every provider, since they cast to concrete types (e.g. [Azure](https://github.com/markbates/goth/blob/master/providers/azureadv2/azureadv2.go#L132)) --------- Co-authored-by: Kyle D <kdumontnu@gmail.com>
* Migrate `gt-hidden` to `tw-hidden` (#30046)silverwind2024-03-241-3/+3
| | | | | | | | | | | | We have to define this one in helpers.css because tailwind only generates a single class but certain things rely on this being double-class. Command ran: ```sh perl -p -i -e 's#gt-hidden#tw-hidden#g' web_src/js/**/* templates/**/* models/**/* web_src/css/**/* --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Update register application URL for GitLab (#29959)yp053272024-03-211-1/+1
| | | | | | Fix #26593 The old URL was updated 7 years ago. Maybe no need to hold it any more. ![image](https://github.com/go-gitea/gitea/assets/18380374/95a0b364-832b-4f10-800e-21845d64df1a)
* Revert "Support SAML authentication (#25165)" (#29358)65432024-02-241-6/+0
| | | | | | | | | | This reverts #25165 (5bb8d1924d77c675467694de26697b876d709a17), as there was a chance some important reviews got missed. so after reverting this patch it will be resubmitted for reviewing again https://github.com/go-gitea/gitea/pull/25165#issuecomment-1960670242 temporary Open #5512 again
* Support SAML authentication (#25165)techknowlogick2024-02-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes https://github.com/go-gitea/gitea/issues/5512 This PR adds basic SAML support - Adds SAML 2.0 as an auth source - Adds SAML configuration documentation - Adds integration test: - Use bare-bones SAML IdP to test protocol flow and test account is linked successfully (only runs on Postgres by default) - Adds documentation for configuring and running SAML integration test locally Future PRs: - Support group mapping - Support auto-registration (account linking) Co-Authored-By: @jackHay22 --------- Co-authored-by: jackHay22 <jack@allspice.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: morphelinho <morphelinho@users.noreply.github.com> Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io>
* Always use `ctx.Locale.Tr` inside templates (#27231)delvh2023-09-251-28/+28
|
* Change green buttons to primary color (#27099)silverwind2023-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | I think it's better if the primary actions have primary color instead of green which fits better into the overall single-color UI design. This PR currently replaces every green button with primary: <img width="141" alt="Screenshot 2023-09-16 at 14 07 59" src="https://github.com/go-gitea/gitea/assets/115237/843c1e50-4fb2-4ec6-84ba-0efb9472dcbe"> <img width="161" alt="Screenshot 2023-09-16 at 14 07 51" src="https://github.com/go-gitea/gitea/assets/115237/9442195a-a3b2-4a42-b262-8377d6f5c0d1"> Modal actions now use uncolored/primary instead of previous green/red colors. I also removed the box-shadow on all basic buttons: <img width="259" alt="Screenshot 2023-09-16 at 14 16 39" src="https://github.com/go-gitea/gitea/assets/115237/5beea529-127a-44b0-8d4c-afa7b034a490"> <img width="261" alt="Screenshot 2023-09-16 at 14 17 42" src="https://github.com/go-gitea/gitea/assets/115237/4757f7b2-4d46-49bc-a797-38bb28437b88"> The change currently includes the "Merge PR" button, for which we might want to make an exception to match the icon color there: <img width="442" alt="Screenshot 2023-09-16 at 14 33 53" src="https://github.com/go-gitea/gitea/assets/115237/993ac1a5-c94d-4895-b76c-0d872181a70b">
* Show OAuth2 errors to end users (#25261)wxiaoguang2023-06-151-4/+4
| | | | | | | | | | | | Partially fix #23936 ![image](https://github.com/go-gitea/gitea/assets/2114189/8aa7f3ad-a5f0-42ce-a478-289a03bd08a3) ![image](https://github.com/go-gitea/gitea/assets/2114189/bb901e7d-485a-47a5-b68d-9ebe7013a6b2) ![image](https://github.com/go-gitea/gitea/assets/2114189/9a1ce0f3-f011-4baf-8e2f-cc6304bc9703)
* Change to vertical navbar layout for secondary navbar for repo/user/admin ↵Hester Gong2023-04-231-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | settings (#24246) Co-Author: @wxiaoguang This is the first step of #24229. And this PR will only includes html changes, and followed by other PRs that fine tune css and change to submenus. After: Admin Level <img width="1400" alt="Screen Shot 2023-04-21 at 10 07 16" src="https://user-images.githubusercontent.com/17645053/233523870-f848b61d-056a-4b41-9760-a9a49fea1fe8.png"> User Level <img width="1422" alt="Screen Shot 2023-04-21 at 10 07 23" src="https://user-images.githubusercontent.com/17645053/233523878-979adb20-a657-43d9-99a6-ad414010c0ef.png"> Repo Level <img width="1404" alt="Screen Shot 2023-04-21 at 10 07 07" src="https://user-images.githubusercontent.com/17645053/233523863-337440bd-c03a-4dfd-87fa-cef40300bfe0.png"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove incorrect HTML self close tag (#23748)wxiaoguang2023-03-271-1/+1
| | | HTML is not XML.
* Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, ↵wxiaoguang2023-02-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | remove inline style=display:none (#22950) Close #22847 This PR: * introduce Gitea's own `showElem` and related functions * remove jQuery show/hide * remove .hide class * remove inline style=display:none From now on: do not use: * "[hidden]" attribute: it's too weak, can not be applied to an element with "display: flex" * ".hidden" class: it has been polluted by Fomantic UI in many cases * inline style="display: none": it's difficult to tweak * jQuery's show/hide/toggle: it can not show/hide elements with "display: xxx !important" only use: * this ".gt-hidden" class * showElem/hideElem/toggleElem functions in "utils/dom.js" cc: @silverwind , this is the all-in-one PR
* Add main landmark to templates and adjust titles (#22670)Felipe Leopoldo Sologuren Gutiérrez2023-02-011-1/+1
| | | | | | | * Add main aria landmark to templates * Adjust some titles to improve understanding of location in navigation Contributed by @Forgejo
* Make sure fmt catches all templates (#20979)silverwind2022-08-311-4/+4
| | | | | | | | * Make sure fmt catches all templates Make's `wildcard` is not recursive so it missed many template files, fix that by using `find`. * Update Makefile
* Refactor `i18n` to `locale` (#20153)Gusted2022-06-271-28/+28
| | | | | | | | | | | * Refactor `i18n` to `locale` - Currently we're using the `i18n` variable naming for the `locale` struct. This contains locale's specific information and cannot be used for general i18n purpose, therefore refactoring it to `locale` makes more sense. - Ref: https://github.com/go-gitea/gitea/pull/20096#discussion_r906699200 * Update routers/install/install.go
* Prevent 500 when there is an error during new auth source post (#19041)zeripath2022-03-101-1/+1
| | | | | Fix #19036 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Disable form autofill (#17291)wxiaoguang2021-10-191-0/+1
| | | | | | | ]* fix aria-hidden and tabindex * use {{template "base/disable_form_autofill"}} instead of {{DisableFormAutofill}} Co-authored-by: zeripath <art27@cantab.net>
* Add SkipLocal2FA option to pam and smtp sources (#17078)zeripath2021-09-261-0/+7
| | | | | | | | | | | | | * Add SkipLocal2FA option to other pam and smtp sources Extend #16954 to allow setting skip local 2fa on pam and SMTP authentication sources Signed-off-by: Andrew Thornton <art27@cantab.net> * make SkipLocal2FA omitempty Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Improve SMTP authentication and Fix user creation bugs (#16612)zeripath2021-08-111-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Improve SMTP authentication, Fix user creation bugs and add LDAP cert/key options This PR has two parts: Improvements for SMTP authentication: * Default to use SMTPS if port is 465, and allow setting of force SMTPS. * Always use STARTTLS if available * Provide CRAM-MD5 mechanism * Add options for HELO hostname disabling * Add options for providing certificates and keys * Handle application specific password response as a failed user login instead of as a 500. Close #16104 Fix creation of new users: * A bug was introduced when allowing users to change usernames which prevents the creation of external users. * The LoginSource refactor also broke this page. Close #16104 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix add authentication page (#16543)zeripath2021-07-251-2/+2
| | | | | | | | | | | | | | | * Fix add authentication page There is a regression in #16199 whereby the add authentication page fails to react to the change in selected type. This is due to the String() method on the LoginSourceType which is ameliorated with an Int() function being added. Following on from this there are a few other related bugs. Fix #16541 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Restore PAM user autocreation functionality (#15825)zeripath2021-05-131-0/+2
| | | | | | | | | | | | | | | | | * Restore PAM user autocreation functionality PAM autoregistration of users currently fails due to email invalidity. This PR adds a new setting to PAM to allow an email domain to be set or just sets the email to the noreply address and if that fails falls back to uuid@localhost Fix #15702 Signed-off-by: Andrew Thornton <art27@cantab.net> * As per KN4CKER Signed-off-by: Andrew Thornton <art27@cantab.net>
* Enforce tab indentation in templates (#15289)silverwind2021-04-101-2/+2
| | | | | | | | | | | | | | | | | | * Enforce tab indendation in templates This adds editorconfig-checker [1] to lint the template files so they conform the editorconfig files. I fixed all current identation issues using the fix mode of eclint [2] and some manual corrections. We can extend this linting to other files later, for now I'd like this PR to focus on HTML template files only. [1] https://github.com/editorconfig-checker/editorconfig-checker [2] https://github.com/jedmao/eclint * fix indendation Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add class to page content to unify top margin (#13766)silverwind2020-11-301-1/+1
| | | | | | | | | | | | | | | | | | | * Add class to page content to unify top margin Previously pages would individually set this margin but some didn't so content would stick to the header without any space. Resolve this by adding a new class that is added on all pages. The only place where we remove this margin again is on the pages with menu or wrapper in the header. * fix admin notices * fix team pages * fix loading segment on gitgraph for arc-green * fix last missing case Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Comment box tweaks and SVG dropdown triangles (#13376)silverwind2020-10-311-1/+1
| | | | | | | | | | | | | | | | | | | | * Comment box tweaks and SVG dropdown triangles - Change all dropdown triangles to SVG - Bring inline review comment box closer to regular comment boxes - Enhance arc-green checkbox contrast - Minor reaction tweaks - Flexbox the diff file header * remove a border * fix type marker in arc-green * add small code padding * fix position regression and remove useless rules Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* #12897 - add mastodon provider (#13293)Divyam Bhasin2020-10-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | * added mastodon provider to oauth code * changed go.mod and vendor/modules.txt to add updated goth * vendored mastodon and new goth * committing result of go mod tidy && go mod vendor * added pic and mastodon to oauth models * handled instance url * applied lafriks suggestion * Update web_src/js/index.js Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <matti@mdranta.net>
* OAuth2: add Yandex provider (#8335) (#10564)Lauris BH2020-03-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | * OAuth2: add Yandex provider (#8335) * remove changes from locale ru-RU * fmt modules/auth/oauth2/oauth2.go Co-Authored-By: 6543 <6543@obermui.de> * fix fmt * Update templates/admin/auth/new.tmpl * fix fmt Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* nextcloud oauth (#10562)techknowlogick2020-03-021-0/+2
| | | Fix #7078
* Add single sign-on support via SSPI on Windows (#8463)QuaSoft2019-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add single sign-on support via SSPI on Windows * Ensure plugins implement interface * Ensure plugins implement interface * Move functions used only by the SSPI auth method to sspi_windows.go * Field SSPISeparatorReplacement of AuthenticationForm should not be required via binding, as binding will insist the field is non-empty even if another login type is selected * Fix breaking of oauth authentication on download links. Do not create new session with SSPI authentication on download links. * Update documentation for the new 'SPNEGO with SSPI' login source * Mention in documentation that ROOT_URL should contain the FQDN of the server * Make sure that Contexter is not checking for active login sources when the ORM engine is not initialized (eg. when installing) * Always initialize and free SSO methods, even if they are not enabled, as a method can be activated while the app is running (from Authentication sources) * Add option in SSPIConfig for removing of domains from logon names * Update helper text for StripDomainNames option * Make sure handleSignIn() is called after a new user object is created by SSPI auth method * Remove default value from text of form field helper Co-Authored-By: Lauris BH <lauris@nix.lv> * Remove default value from text of form field helper Co-Authored-By: Lauris BH <lauris@nix.lv> * Remove default value from text of form field helper Co-Authored-By: Lauris BH <lauris@nix.lv> * Only make a query to the DB to check if SSPI is enabled on handlers that need that information for templates * Remove code duplication * Log errors in ActiveLoginSources Co-Authored-By: Lauris BH <lauris@nix.lv> * Revert suffix of randomly generated E-mails for Reverse proxy authentication Co-Authored-By: Lauris BH <lauris@nix.lv> * Revert unneeded white-space change in template Co-Authored-By: Lauris BH <lauris@nix.lv> * Add copyright comments at the top of new files * Use loopback name for randomly generated emails * Add locale tag for the SSPISeparatorReplacement field with proper casing * Revert casing of SSPISeparatorReplacement field in locale file, moving it up, next to other form fields * Update docs/content/doc/features/authentication.en-us.md Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * Remove Priority() method and define the order in which SSO auth methods should be executed in one place * Log authenticated username only if it's not empty * Rephrase helper text for automatic creation of users * Return error if more than one active SSPI auth source is found * Change newUser() function to return error, letting caller log/handle the error * Move isPublicResource, isPublicPage and handleSignIn functions outside SSPI auth method to allow other SSO methods to reuse them if needed * Refactor initialization of the list containing SSO auth methods * Validate SSPI settings on POST * Change SSPI to only perform authentication on its own login page, API paths and download links. Leave Toggle middleware to redirect non authenticated users to login page * Make 'Default language' in SSPI config empty, unless changed by admin * Show error if admin tries to add a second authentication source of type SSPI * Simplify declaration of global variable * Rebuild gitgraph.js on Linux * Make sure config values containing only whitespace are not accepted
* migrate gplus to google oauth2 provider (#7885)techknowlogick2019-09-141-1/+1
| | | | | | | | | | * migrate gplus to google oauth2 provider. this still provides support for old gplus connections. * Update models/oauth2.go Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com> * make vendor
* oauth2 with remote Gitea - Fix #8093 (#8149)techknowlogick2019-09-121-0/+2
|
* Discord Oauth2 support (#4476)techknowlogick2019-01-131-0/+2
| | | | | | | | | | | | | | * add discord auth * add vendor for discord * fix syntax error * make fmt * update version of goth in use * update markbates/goth
* LDAP user synchronization (#1478)Lauris BH2017-05-101-0/+6
|
* Additional OAuth2 providers (#1010)Willem van Dreumel2017-05-011-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add google+ * sort signin oauth2 providers based on the name so order is always the same * update auth tip for google+ * add gitlab provider * add bitbucket provider (and some go fmt) * add twitter provider * add facebook provider * add dropbox provider * add openid connect provider incl. new format of tips section in "Add New Source" * lower the amount of disk storage for each session to prevent issues while building cross platform (and disk overflow) * imports according to goimport and code style * make it possible to set custom urls to gitlab and github provider (only these could have a different host) * split up oauth2 into multiple files * small typo in comment * fix indention * fix indentation * fix new line before external import * fix layout of signin part * update "broken" dependency
* Refactor admin/auth/new.tmpl (#1277)Kim "BKC" Carlbäcker2017-03-171-116/+3
|
* Cleaner ui for admin, repo settings, and user settings page (#1269) (#1270)Patrick G2017-03-151-183/+179
|
* Oauth2 consumer (#679)Willem van Dreumel2017-02-221-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | * initial stuff for oauth2 login, fails on: * login button on the signIn page to start the OAuth2 flow and a callback for each provider Only GitHub is implemented for now * show login button only when the OAuth2 consumer is configured (and activated) * create macaron group for oauth2 urls * prevent net/http in modules (other then oauth2) * use a new data sessions oauth2 folder for storing the oauth2 session data * add missing 2FA when this is enabled on the user * add password option for OAuth2 user , for use with git over http and login to the GUI * add tip for registering a GitHub OAuth application * at startup of Gitea register all configured providers and also on adding/deleting of new providers * custom handling of errors in oauth2 request init + show better tip * add ExternalLoginUser model and migration script to add it to database * link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed * remove the linked external account from the user his settings * if user is unknown we allow him to register a new account or link it to some existing account * sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers) * from gorilla/sessions docs: "Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!" (we're using gorilla/sessions for storing oauth2 sessions) * use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
* fix grammar + typo. (#3453)Justin Ray Vrooman2016-08-121-2/+2
|
* Use SecurityProtocol to replace UseSSL in LDAP configUnknwon2016-07-081-3/+16
| | | | Initially proposed by #2376 and fixes #3068 as well.
* Minor fix for #2634Unknwon2016-02-201-0/+6
| | | | Add AttributesInBind option in new auth source form.
* LDAP parameters UI: bind_dn and bind_password are not requiredSlavikZ2015-12-091-2/+2
|
* Indent all templates with tabsAdam Strzelecki2015-12-081-148/+148
| | | | | | | | | | | | This commit improves templates readability, since all of them use consistent indent with all template command blocks indented too. 1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks such as {{if}} {{with}} 2. Cleans all trailing white-space 3. Adds trailing last line-break to each file
* LDAP: Optional user name attribute specificationAdam Strzelecki2015-12-021-0/+4
| | | | | | | | | | | | | | | Consider following LDAP search query example: (&(objectClass=Person)(|(uid=%s)(mail=%s))) Right now on first login attempt Gogs will use the text supplied on login form as the newly created user name. In example query above the text matches against both e-mail or user name. So if user puts the e-mail then the new Gogs user name will be e-mail which may be undesired. Using optional user name attribute setting we can explicitly say we want Gogs user name to be certain LDAP attribute eg. `uid`, so even user will use e-mail to login 1st time, the new account will receive correct user name.
* revert simple LDAP userDN and update exampleUnknwon2015-09-161-1/+1
|
* #1637 able to skip verify for LDAPUnknwon2015-09-141-1/+1
|
* #1625 remove auto_register and makes it defaultUnknwon2015-09-121-6/+0
|
* #1620 add allowed domains for SMTP authUnknwon2015-09-111-0/+5
|
* finish new edit auth UIUnknwon2015-09-111-28/+28
|
* finish new add auth UIUnknwon2015-09-101-135/+151
|
* Added LDAP simple auth support.Sergio Benitez2015-09-041-12/+16
|
* #1542 A way to skip TLS verify for SMTP authenticationUnknwon2015-08-291-0/+4
|