This repository has been archived on 2024-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
forgejo/docs/content/doc
Martin Michaelis 55eb1745bd
OAuth2 auto-register (#5123)
* Refactored handleOAuth2SignIn in routers/user/auth.go

The function handleOAuth2SignIn was called twice but some code path could only
be reached by one of the invocations. Moved the unnecessary code path out of
handleOAuth2SignIn.


* Refactored user creation

There was common code to create a user and display the correct error message.
And after the creation the only user should be an admin and if enabled a
confirmation email should be sent. This common code is now abstracted into
two functions and a helper function to call both.

* Added auto-register for OAuth2 users

If enabled new OAuth2 users will be registered with their OAuth2 details.
The UserID, Name and Email fields from the gothUser are used.
Therefore the OpenID Connect provider needs additional scopes to return
the coresponding claims.

* Added error for missing fields in OAuth2 response

* Linking and auto linking on oauth2 registration

* Set default username source to nickname

* Add automatic oauth2 scopes for github and google

* Add hint to change the openid connect scopes if fields are missing

* Extend info about auto linking security risk

Co-authored-by: Viktor Kuzmin <kvaster@gmail.com>
Signed-off-by: Martin Michaelis <code@mgjm.de>
2021-04-14 14:02:12 +02:00
..
advanced OAuth2 auto-register (#5123) 2021-04-14 14:02:12 +02:00
developers [docs] Add zh-tw Translations (#14507) 2021-01-29 01:57:58 +01:00
features Update comparison docs for gitlab (#14999) 2021-03-15 11:19:00 -04:00
help Allow blocking some email domains from registering an account (#14667) 2021-02-15 00:31:29 +01:00
installation docs: rm deprecated docs regarding environment variable usage in docker image (#15405) 2021-04-12 15:42:02 -04:00
translation Add german translation guidelines (#14283) 2021-01-22 20:12:50 +01:00
upgrade [docs] Add zh-tw Translations (#14507) 2021-01-29 01:57:58 +01:00
usage [docs] Fix typo in command-line.en-us.md (#14746) 2021-02-19 11:29:22 -05:00
advanced.en-us.md
advanced.fr-fr.md
advanced.zh-cn.md
advanced.zh-tw.md [docs] Add zh-tw Translations (#14507) 2021-01-29 01:57:58 +01:00
developers.en-us.md Refactor docs (#13275) 2020-10-23 11:59:45 -04:00
developers.zh-tw.md [docs] Add zh-tw Translations (#14507) 2021-01-29 01:57:58 +01:00
features.en-us.md
features.zh-cn.md
features.zh-tw.md
help.en-us.md Implement documentation search (#8937) 2019-11-13 18:03:18 +00:00
help.fr-fr.md Implement documentation search (#8937) 2019-11-13 18:03:18 +00:00
help.zh-cn.md Implement documentation search (#8937) 2019-11-13 18:03:18 +00:00
help.zh-tw.md [docs] Add zh-tw Translations (#14507) 2021-01-29 01:57:58 +01:00
installation.en-us.md
installation.fr-fr.md
installation.zh-cn.md
installation.zh-tw.md
translation.de-de.md Add german translation guidelines (#14283) 2021-01-22 20:12:50 +01:00
translation.en-us.md Add german translation guidelines (#14283) 2021-01-22 20:12:50 +01:00
translation.zh-tw.md [docs] Add zh-tw Translations (#14507) 2021-01-29 01:57:58 +01:00
upgrade.en-us.md
upgrade.fr-fr.md
upgrade.zh-cn.md
upgrade.zh-tw.md
usage.en-us.md
usage.zh-cn.md
usage.zh-tw.md [docs] Add zh-tw Translations (#14507) 2021-01-29 01:57:58 +01:00