gitea/docs/content/doc/advanced
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
..
adding-legal-pages.en-us.md Add Privacy Policy and Terms of Service Page (#9513) 2020-01-14 14:34:40 +01:00
clone-filter.en-us.md [Docs] Clone filters (#14555) 2021-02-03 10:11:20 -05:00
cmd-embedded.en-us.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
config-cheat-sheet.en-us.md OAuth2 auto-register (#5123) 2021-04-14 14:02:12 +02:00
config-cheat-sheet.zh-cn.md Add NeedPostProcess for Parser interface to improve performance of csv render (#15153) 2021-04-13 15:06:31 +08:00
customizing-gitea.en-us.md Note that all template directories are relative to the `CustomPath` configuration, not a `custom` directory inside it (#14399) 2021-01-19 10:50:55 -05:00
customizing-gitea.zh-cn.md Rename custom/conf/app.ini.sample to custom/conf/app.example.ini for better syntax light on editor (#11926) 2020-06-17 23:16:59 -04:00
environment-variables.en-us.md Update docs and comments to remove macaron (#14491) 2021-01-29 16:35:30 +01:00
environment-variables.zh-cn.md Update docs and comments to remove macaron (#14491) 2021-01-29 16:35:30 +01:00
external-renderers.en-us.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
hacking-on-gitea.zh-cn.md ZH-CN translation of Advanced part (#5090) 2018-10-17 14:21:20 +03:00
logging-documentation.en-us.md Update docs and comments to remove macaron (#14491) 2021-01-29 16:35:30 +01:00
mail-templates-us.md Fix documentation for the fallback mail subject (#15223) 2021-03-31 11:36:21 -04:00
make.fr-fr.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
make.zh-cn.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
repo-indexer.en-us.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
search-engines-indexation.en-us.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
signing.en-us.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00
third-party-tools.zh-cn.md Reformat docs (#13897) 2020-12-09 07:47:06 +01:00