Skip to content
Snippets Groups Projects
Commit fe3e4e9c authored by Sandra Westerhoff's avatar Sandra Westerhoff
Browse files

Update: extend parsing of pairwise id (coscine/issues#2115)

parent 492bcdb4
Branches Issue/2115-extendParsingPairwiseId
Tags
2 merge requests!126Release: Sprint/2022 11 :robot:,!124Issue/2115 extend parsing pairwise id
......@@ -48,12 +48,22 @@ namespace Coscine.Api.STS.Controllers
entity = info.Principal.FindFirstValue(ShibbolethAttributeMapping.PairwiseID);
}
var identifier = entity[(entity.IndexOf(">") + 1)..];
identifier = identifier.Substring(0, identifier.IndexOf("<"));
var entityId = entity[(entity.IndexOf("NameQualifier=\"") + "NameQualifier=\"".Length)..];
entityId = entityId.Substring(0, entityId.IndexOf("\""));
var identifier = "";
var entityId = "";
if (entity.IndexOf(">") > -1)
{
identifier = entity[(entity.IndexOf(">") + 1)..];
identifier = identifier.Substring(0, identifier.IndexOf("<"));
entityId = entity[(entity.IndexOf("NameQualifier=\"") + "NameQualifier=\"".Length)..];
entityId = entityId.Substring(0, entityId.IndexOf("\""));
}
else
{
identifier = entity;
entityId = info.AuthenticationProperties.Items["idp"];
}
var mapping = externalIdModel.GetAllWhere((map) =>
map.ExternalId1 == identifier
&& map.ExternalAuthenticatorId == shibbolethAuthItem.Id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment