[#2533] added VK OAuth2 provider

Co-authored-by: Valentine <xb2w1z@gmail.com>
This commit is contained in:
Gani Georgiev
2023-05-24 15:34:25 +03:00
parent e40cf46b33
commit af71b63f23
41 changed files with 173 additions and 39 deletions
+6 -1
View File
@@ -139,9 +139,14 @@ func (api *recordAuthApi) authMethods(c echo.Context) error {
oauth2.SetAuthURLParam("code_challenge_method", codeChallengeMethod),
}
if name == auth.NameApple {
// custom providers url options
switch name {
case auth.NameApple:
// see https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms#3332113
urlOpts = append(urlOpts, oauth2.SetAuthURLParam("response_mode", "query"))
case auth.NameVK:
// vk currently doesn't support PKCE for server-side authorization
urlOpts = []oauth2.AuthCodeOption{}
}
result.AuthProviders = append(result.AuthProviders, providerInfo{
+3
View File
@@ -76,6 +76,7 @@ func TestSettingsList(t *testing.T) {
`"oidc3Auth":{`,
`"appleAuth":{`,
`"instagramAuth":{`,
`"vkAuth":{`,
`"secret":"******"`,
`"clientSecret":"******"`,
},
@@ -155,6 +156,7 @@ func TestSettingsSet(t *testing.T) {
`"oidc3Auth":{`,
`"appleAuth":{`,
`"instagramAuth":{`,
`"vkAuth":{`,
`"secret":"******"`,
`"clientSecret":"******"`,
`"appName":"acme_test"`,
@@ -223,6 +225,7 @@ func TestSettingsSet(t *testing.T) {
`"oidc3Auth":{`,
`"appleAuth":{`,
`"instagramAuth":{`,
`"vkAuth":{`,
`"secret":"******"`,
`"clientSecret":"******"`,
`"appName":"update_test"`,