mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
feat: can configure Domain field in Nextcloud OAuth provider (#3813)
This commit is contained in:
13
idp/goth.go
13
idp/goth.go
@ -278,9 +278,16 @@ func NewGothIdProvider(providerType string, clientId string, clientSecret string
|
|||||||
Session: &naver.Session{},
|
Session: &naver.Session{},
|
||||||
}
|
}
|
||||||
case "Nextcloud":
|
case "Nextcloud":
|
||||||
idp = GothIdProvider{
|
if hostUrl != "" {
|
||||||
Provider: nextcloud.New(clientId, clientSecret, redirectUrl),
|
idp = GothIdProvider{
|
||||||
Session: &nextcloud.Session{},
|
Provider: nextcloud.NewCustomisedDNS(clientId, clientSecret, redirectUrl, hostUrl),
|
||||||
|
Session: &nextcloud.Session{},
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
idp = GothIdProvider{
|
||||||
|
Provider: nextcloud.New(clientId, clientSecret, redirectUrl),
|
||||||
|
Session: &nextcloud.Session{},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case "OneDrive":
|
case "OneDrive":
|
||||||
idp = GothIdProvider{
|
idp = GothIdProvider{
|
||||||
|
@ -950,7 +950,7 @@ class ProviderEditPage extends React.Component {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
this.state.provider.type !== "ADFS" && this.state.provider.type !== "AzureAD" && this.state.provider.type !== "AzureADB2C" && (this.state.provider.type !== "Casdoor" && this.state.category !== "Storage") && this.state.provider.type !== "Okta" ? null : (
|
this.state.provider.type !== "ADFS" && this.state.provider.type !== "AzureAD" && this.state.provider.type !== "AzureADB2C" && (this.state.provider.type !== "Casdoor" && this.state.category !== "Storage") && this.state.provider.type !== "Okta" && this.state.provider.type !== "Nextcloud" ? null : (
|
||||||
<Row style={{marginTop: "20px"}} >
|
<Row style={{marginTop: "20px"}} >
|
||||||
<Col style={{marginTop: "5px"}} span={2}>
|
<Col style={{marginTop: "5px"}} span={2}>
|
||||||
{Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} :
|
{Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} :
|
||||||
|
@ -402,6 +402,10 @@ export function getAuthUrl(application, provider, method, code) {
|
|||||||
redirectUri = `${redirectOrigin}/api/callback`;
|
redirectUri = `${redirectOrigin}/api/callback`;
|
||||||
} else if (provider.type === "Google" && provider.disableSsl) {
|
} else if (provider.type === "Google" && provider.disableSsl) {
|
||||||
scope += "+https://www.googleapis.com/auth/user.phonenumbers.read";
|
scope += "+https://www.googleapis.com/auth/user.phonenumbers.read";
|
||||||
|
} else if (provider.type === "Nextcloud") {
|
||||||
|
if (provider.domain) {
|
||||||
|
endpoint = `${provider.domain}/apps/oauth2/authorize`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (provider.type === "Google" || provider.type === "GitHub" || provider.type === "Facebook"
|
if (provider.type === "Google" || provider.type === "GitHub" || provider.type === "Facebook"
|
||||||
|
Reference in New Issue
Block a user