diff options
author | Lauris BH <lauris@nix.lv> | 2020-03-05 00:08:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 00:08:52 +0200 |
commit | 3d5d21133ca93ab5ab4482bac11ca7c4fa21c407 (patch) | |
tree | 4a0477b42887d66631ca6fa1b90edecfbb0014c1 /modules/auth | |
parent | afa1e1af16caa19e48de85d9d3697111ceeff9ce (diff) | |
download | gitea-3d5d21133ca93ab5ab4482bac11ca7c4fa21c407.tar.gz gitea-3d5d21133ca93ab5ab4482bac11ca7c4fa21c407.zip |
OAuth2: add Yandex provider (#8335) (#10564)
* 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>
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/oauth2/oauth2.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/auth/oauth2/oauth2.go b/modules/auth/oauth2/oauth2.go index 193a87c4e8..0b18afdaf7 100644 --- a/modules/auth/oauth2/oauth2.go +++ b/modules/auth/oauth2/oauth2.go @@ -25,6 +25,7 @@ import ( "github.com/markbates/goth/providers/nextcloud" "github.com/markbates/goth/providers/openidConnect" "github.com/markbates/goth/providers/twitter" + "github.com/markbates/goth/providers/yandex" "github.com/satori/go.uuid" "xorm.io/xorm" ) @@ -209,6 +210,9 @@ func createProvider(providerName, providerType, clientID, clientSecret, openIDCo } } provider = nextcloud.NewCustomisedURL(clientID, clientSecret, callbackURL, authURL, tokenURL, profileURL) + case "yandex": + // See https://tech.yandex.com/passport/doc/dg/reference/response-docpage/ + provider = yandex.New(clientID, clientSecret, callbackURL, "login:email", "login:info", "login:avatar") } // always set the name if provider is created so we can support multiple setups of 1 provider |