diff options
author | techknowlogick <techknowlogick@gitea.io> | 2020-03-02 22:11:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 22:11:45 -0500 |
commit | bea497ff96f4deae617e54468576d11d105e2125 (patch) | |
tree | 9c59c9bc2f987733c4f8a535781d16acbd68b563 /models | |
parent | 07f6ae30e49b3dd64280d0eeb142de89806365ea (diff) | |
download | gitea-bea497ff96f4deae617e54468576d11d105e2125.tar.gz gitea-bea497ff96f4deae617e54468576d11d105e2125.zip |
nextcloud oauth (#10562)
Fix #7078
Diffstat (limited to 'models')
-rw-r--r-- | models/oauth2.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/models/oauth2.go b/models/oauth2.go index ee3ea4b924..8164699d8d 100644 --- a/models/oauth2.go +++ b/models/oauth2.go @@ -51,15 +51,23 @@ var OAuth2Providers = map[string]OAuth2Provider{ ProfileURL: oauth2.GetDefaultProfileURL("gitea"), }, }, + "nextcloud": {Name: "nextcloud", DisplayName: "Nextcloud", Image: "/img/auth/nextcloud.png", + CustomURLMapping: &oauth2.CustomURLMapping{ + TokenURL: oauth2.GetDefaultTokenURL("nextcloud"), + AuthURL: oauth2.GetDefaultAuthURL("nextcloud"), + ProfileURL: oauth2.GetDefaultProfileURL("nextcloud"), + }, + }, } // OAuth2DefaultCustomURLMappings contains the map of default URL's for OAuth2 providers that are allowed to have custom urls // key is used to map the OAuth2Provider // value is the mapping as defined for the OAuth2Provider var OAuth2DefaultCustomURLMappings = map[string]*oauth2.CustomURLMapping{ - "github": OAuth2Providers["github"].CustomURLMapping, - "gitlab": OAuth2Providers["gitlab"].CustomURLMapping, - "gitea": OAuth2Providers["gitea"].CustomURLMapping, + "github": OAuth2Providers["github"].CustomURLMapping, + "gitlab": OAuth2Providers["gitlab"].CustomURLMapping, + "gitea": OAuth2Providers["gitea"].CustomURLMapping, + "nextcloud": OAuth2Providers["nextcloud"].CustomURLMapping, } // GetActiveOAuth2ProviderLoginSources returns all actived LoginOAuth2 sources |