mirror of
https://github.com/casdoor/casdoor.git
synced 2025-09-09 03:12:56 +08:00
feat: fix non-standard CAS bug (#4146)
This commit is contained in:
@@ -67,6 +67,14 @@ type CasAttributes struct {
|
|||||||
LongTermAuthenticationRequestTokenUsed bool `xml:"cas:longTermAuthenticationRequestTokenUsed"`
|
LongTermAuthenticationRequestTokenUsed bool `xml:"cas:longTermAuthenticationRequestTokenUsed"`
|
||||||
IsFromNewLogin bool `xml:"cas:isFromNewLogin"`
|
IsFromNewLogin bool `xml:"cas:isFromNewLogin"`
|
||||||
MemberOf []string `xml:"cas:memberOf"`
|
MemberOf []string `xml:"cas:memberOf"`
|
||||||
|
FirstName string `xml:"cas:firstName,omitempty"`
|
||||||
|
LastName string `xml:"cas:lastName,omitempty"`
|
||||||
|
Title string `xml:"cas:title,omitempty"`
|
||||||
|
Email string `xml:"cas:email,omitempty"`
|
||||||
|
Affiliation string `xml:"cas:affiliation,omitempty"`
|
||||||
|
Avatar string `xml:"cas:avatar,omitempty"`
|
||||||
|
Phone string `xml:"cas:phone,omitempty"`
|
||||||
|
DisplayName string `xml:"cas:displayName,omitempty"`
|
||||||
UserAttributes *CasUserAttributes
|
UserAttributes *CasUserAttributes
|
||||||
ExtraAttributes []*CasAnyAttribute `xml:",any"`
|
ExtraAttributes []*CasAnyAttribute `xml:",any"`
|
||||||
}
|
}
|
||||||
@@ -240,6 +248,24 @@ func GenerateCasToken(userId string, service string) (string, error) {
|
|||||||
} else {
|
} else {
|
||||||
value = escapedValue
|
value = escapedValue
|
||||||
}
|
}
|
||||||
|
switch k {
|
||||||
|
case "firstName":
|
||||||
|
authenticationSuccess.Attributes.FirstName = value
|
||||||
|
case "lastName":
|
||||||
|
authenticationSuccess.Attributes.LastName = value
|
||||||
|
case "title":
|
||||||
|
authenticationSuccess.Attributes.Title = value
|
||||||
|
case "email":
|
||||||
|
authenticationSuccess.Attributes.Email = value
|
||||||
|
case "affiliation":
|
||||||
|
authenticationSuccess.Attributes.Affiliation = value
|
||||||
|
case "avatar":
|
||||||
|
authenticationSuccess.Attributes.Avatar = value
|
||||||
|
case "phone":
|
||||||
|
authenticationSuccess.Attributes.Phone = value
|
||||||
|
case "displayName":
|
||||||
|
authenticationSuccess.Attributes.DisplayName = value
|
||||||
|
}
|
||||||
authenticationSuccess.Attributes.UserAttributes.Attributes = append(authenticationSuccess.Attributes.UserAttributes.Attributes, &CasNamedAttribute{
|
authenticationSuccess.Attributes.UserAttributes.Attributes = append(authenticationSuccess.Attributes.UserAttributes.Attributes, &CasNamedAttribute{
|
||||||
Name: k,
|
Name: k,
|
||||||
Value: value,
|
Value: value,
|
||||||
|
@@ -20,26 +20,34 @@ module.exports = {
|
|||||||
target: "http://localhost:8000",
|
target: "http://localhost:8000",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/cas/serviceValidate": {
|
"/cas/**/serviceValidate": {
|
||||||
target: "http://localhost:8000",
|
target: "http://localhost:8000",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/cas/proxyValidate": {
|
"/cas/**/proxyValidate": {
|
||||||
target: "http://localhost:8000",
|
target: "http://localhost:8000",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/cas/proxy": {
|
"/cas/**/proxy": {
|
||||||
target: "http://localhost:8000",
|
target: "http://localhost:8000",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/cas/validate": {
|
"/cas/**/validate": {
|
||||||
|
target: "http://localhost:8000",
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
"/cas/**/p3/serviceValidate": {
|
||||||
|
target: "http://localhost:8000",
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
"/cas/**/p3/proxyValidate": {
|
||||||
target: "http://localhost:8000",
|
target: "http://localhost:8000",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
"/scim": {
|
"/scim": {
|
||||||
target: "http://localhost:8000",
|
target: "http://localhost:8000",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
Reference in New Issue
Block a user