diff --git a/object/token_cas.go b/object/token_cas.go index 1c7892f0..8faaa386 100644 --- a/object/token_cas.go +++ b/object/token_cas.go @@ -67,6 +67,14 @@ type CasAttributes struct { LongTermAuthenticationRequestTokenUsed bool `xml:"cas:longTermAuthenticationRequestTokenUsed"` IsFromNewLogin bool `xml:"cas:isFromNewLogin"` 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 ExtraAttributes []*CasAnyAttribute `xml:",any"` } @@ -240,6 +248,24 @@ func GenerateCasToken(userId string, service string) (string, error) { } else { 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{ Name: k, Value: value, diff --git a/web/craco.config.js b/web/craco.config.js index 643a1385..9abbb410 100644 --- a/web/craco.config.js +++ b/web/craco.config.js @@ -20,26 +20,34 @@ module.exports = { target: "http://localhost:8000", changeOrigin: true, }, - "/cas/serviceValidate": { + "/cas/**/serviceValidate": { target: "http://localhost:8000", changeOrigin: true, }, - "/cas/proxyValidate": { + "/cas/**/proxyValidate": { target: "http://localhost:8000", changeOrigin: true, }, - "/cas/proxy": { + "/cas/**/proxy": { target: "http://localhost:8000", 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", changeOrigin: true, }, "/scim": { target: "http://localhost:8000", changeOrigin: true, - } + }, }, }, plugins: [