summaryrefslogtreecommitdiffstats
path: root/models/oauth2.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/oauth2.go')
-rw-r--r--models/oauth2.go14
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