From bea497ff96f4deae617e54468576d11d105e2125 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Mon, 2 Mar 2020 22:11:45 -0500 Subject: nextcloud oauth (#10562) Fix #7078 --- models/oauth2.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'models/oauth2.go') 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 -- cgit v1.2.3