Skip to content
Snippets Groups Projects
Commit 8fc89fc7 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs
Browse files

Fix: Add and change surname and givenname (coscine/issues#280)

parent a6079c4a
No related branches found
No related tags found
1 merge request!7Hotfix/280 surname and givenname
......@@ -33,8 +33,8 @@ namespace Coscine.STS.Controllers
if (ModelState.IsValid)
{
var claimsPrincipal = ORCiDHandler.VerifiyORCiDJWT(model.ORCiD_JWT);
string surName = "";
string givenName = "";
string surname = "";
string givenname = "";
string ORCiD = "";
foreach (var claim in claimsPrincipal.Claims)
{
......@@ -44,11 +44,11 @@ namespace Coscine.STS.Controllers
}
else if(claim.Type == ClaimTypes.Surname)
{
surName = claim.Value;
surname = claim.Value;
}
else if(claim.Type == ClaimTypes.GivenName)
{
givenName = claim.Value;
givenname = claim.Value;
}
}
......@@ -67,8 +67,10 @@ namespace Coscine.STS.Controllers
UserPlainModel userPlainModel = new UserPlainModel(Program.Configuration);
var user = new User
{
DisplayName = surName + " " + givenName,
EmailAddress = ORCiD + "@orcid.org"
DisplayName = givenname + " " + surname,
EmailAddress = ORCiD + "@orcid.org",
Surname = surname,
Givenname = givenname
};
userPlainModel.Insert(user);
externalIdModel.Insert(new ExternalId
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment