Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
apis
STS
Commits
fb813c73
Commit
fb813c73
authored
Apr 26, 2022
by
Petar Hristov
💬
Browse files
Merge branch 'Issue/2078-renamingEntitlementAcceptStaff' into 'master'
Fix: Dealing correctly with entitlement See merge request
!114
parents
d4277b20
6ec6cf88
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/STS/Controllers/ShibbolethController.cs
View file @
fb813c73
...
...
@@ -94,9 +94,9 @@ namespace Coscine.Api.STS.Controllers
_rdfStoreConnector
.
RemoveMembershipData
(
userGraphName
,
organization
);
// Reverse lookup...
var
eduPersonScopedAffiliation
=
info
.
Principal
.
FindAll
(
ShibbolethAttributeMapping
.
LabelMapping
.
FirstOrDefault
(
x
=>
x
.
Value
==
"
Entitlement
"
).
Key
);
var
eduPersonScopedAffiliation
=
info
.
Principal
.
FindAll
(
ShibbolethAttributeMapping
.
LabelMapping
.
FirstOrDefault
(
x
=>
x
.
Value
==
"
ScopedAffiliation
"
).
Key
);
var
orgFromId
=
_rdfStoreConnector
.
GetOrgnizationWithIdentifier
(
identifier
);
if
(
eduPersonScopedAffiliation
.
Any
(
x
=>
x
.
Value
.
StartsWith
(
"employee@"
)))
if
(
eduPersonScopedAffiliation
.
Any
(
x
=>
x
.
Value
.
StartsWith
(
"employee@"
)
||
x
.
Value
.
StartsWith
(
"staff@"
)
))
{
// Add membership information.
_rdfStoreConnector
.
AddMemebershipData
(
userGraphName
,
organization
);
...
...
src/STS/Utils/ShibbolethAttributeMapping.cs
View file @
fb813c73
...
...
@@ -17,7 +17,7 @@ namespace Coscine.Api.STS.Utils
{
"urn:oid:2.5.4.4"
,
"Surname"
},
{
"urn:oid:1.3.6.1.4.1.5540.2.1.96"
,
"Givenname"
},
{
"urn:oid:0.9.2342.19200300.100.1.3"
,
"EmailAddress"
},
{
"urn:oid:1.3.6.1.4.1.5923.1.1.1.9"
,
"
Entitlement
"
},
{
"urn:oid:1.3.6.1.4.1.5923.1.1.1.9"
,
"
ScopedAffiliation
"
},
{
"urn:oid:2.5.4.10"
,
"Organization"
},
};
...
...
@@ -38,7 +38,7 @@ namespace Coscine.Api.STS.Utils
user
.
EmailAddress
=
(
string
)
value
;
break
;
case
"urn:oid:1.3.6.1.4.1.5923.1.1.1.9"
:
if
(
user
.
Entitlement
==
null
||
!
user
.
Entitlement
.
Contains
(
"employee"
))
if
(
user
.
Entitlement
==
null
||
!
(
user
.
Entitlement
.
Contains
(
"employee"
)
||
user
.
Entitlement
.
Contains
(
"staff"
))
)
{
user
.
Entitlement
=
(
string
)
value
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment