diff --git a/src/security/authentication/Netmash.Security.Authentication.Tuitio/Constants/ClaimTypes.cs b/src/security/authentication/Netmash.Security.Authentication.Tuitio/Constants/ClaimTypes.cs
index eb36c35..4a9dc01 100644
--- a/src/security/authentication/Netmash.Security.Authentication.Tuitio/Constants/ClaimTypes.cs
+++ b/src/security/authentication/Netmash.Security.Authentication.Tuitio/Constants/ClaimTypes.cs
@@ -6,7 +6,6 @@
UserName = "UserName",
FirstName = "FirstName",
LastName = "LastName",
- IsGuestUser = "IsGuestUser",
- ProfilePictureUrl = "ProfilePictureUrl";
+ IsGuestUser = "IsGuestUser";
}
}
diff --git a/src/security/authentication/Netmash.Security.Authentication.Tuitio/Netmash.Security.Authentication.Tuitio.csproj b/src/security/authentication/Netmash.Security.Authentication.Tuitio/Netmash.Security.Authentication.Tuitio.csproj
index 69e5051..4c18dd7 100644
--- a/src/security/authentication/Netmash.Security.Authentication.Tuitio/Netmash.Security.Authentication.Tuitio.csproj
+++ b/src/security/authentication/Netmash.Security.Authentication.Tuitio/Netmash.Security.Authentication.Tuitio.csproj
@@ -13,11 +13,11 @@
README.md
Toodle HomeLab
Toodle Netmash
- 2.1.0
+ 2.2.0
-
+
diff --git a/src/security/authentication/Netmash.Security.Authentication.Tuitio/ReleaseNotes.txt b/src/security/authentication/Netmash.Security.Authentication.Tuitio/ReleaseNotes.txt
index ea4d814..94891c4 100644
--- a/src/security/authentication/Netmash.Security.Authentication.Tuitio/ReleaseNotes.txt
+++ b/src/security/authentication/Netmash.Security.Authentication.Tuitio/ReleaseNotes.txt
@@ -1,4 +1,8 @@
-2.1.0 release [2023-03-07 23:35]
+2.2.0 release [2023-04-01 22:24]
+◾ Tuitio nuget packages upgrade
+◾ Removed user profile picture url from authentication claims
+
+2.1.0 release [2023-03-07 23:35]
◾ Tuitio nuget packages upgrade
◾ Tuitio refactoring
diff --git a/src/security/authentication/Netmash.Security.Authentication.Tuitio/TuitioAuthenticationHandler.cs b/src/security/authentication/Netmash.Security.Authentication.Tuitio/TuitioAuthenticationHandler.cs
index c613b23..7ebcd71 100644
--- a/src/security/authentication/Netmash.Security.Authentication.Tuitio/TuitioAuthenticationHandler.cs
+++ b/src/security/authentication/Netmash.Security.Authentication.Tuitio/TuitioAuthenticationHandler.cs
@@ -42,7 +42,7 @@ namespace Netmash.Security.Authentication.Tuitio
catch (Exception e)
{
_logger.LogError(e, "Tuitio authorization failed");
- return AuthenticateResult.Fail("Invalid authorization");
+ return AuthenticateResult.Fail("UNAUTHORIZED");
}
if (!string.IsNullOrEmpty(authorizationEnvelope.Error))
@@ -59,7 +59,7 @@ namespace Netmash.Security.Authentication.Tuitio
return AuthenticateResult.Success(guestTicket);
}
- return AuthenticateResult.Fail("Missing authorization header");
+ return AuthenticateResult.Fail("AUTHORIZATION_HEADER_IS_MISSING");
}
private string GetAuthorizationToken()
@@ -104,18 +104,31 @@ namespace Netmash.Security.Authentication.Tuitio
};
if (authorization.FirstName != null)
+ {
+ claimCollection.Add(ClaimTypes.GivenName, authorization.FirstName);
claimCollection.Add(Constants.ClaimTypes.FirstName, authorization.FirstName);
+ }
+
if (authorization.LastName != null)
+ {
+ claimCollection.Add(ClaimTypes.Surname, authorization.FirstName);
claimCollection.Add(Constants.ClaimTypes.LastName, authorization.LastName);
- if (authorization.ProfilePictureUrl != null)
- claimCollection.Add(Constants.ClaimTypes.ProfilePictureUrl, authorization.ProfilePictureUrl);
+ }
+
if (authorization.Email != null)
claimCollection.Add(ClaimTypes.Email, authorization.Email);
if (authorization.Claims != null && authorization.Claims.Any())
{
foreach (var claim in authorization.Claims)
+ {
+ if (claimCollection.ContainsKey(claim.Key))
+ {
+ _logger.LogWarning($"There is already a claim with key {claim.Key} in the collection. The combination {claim.Key}:{claim.Value} will be ignored.");
+ continue;
+ }
claimCollection.Add(claim.Key, claim.Value);
+ }
}
var claims = claimCollection.Select(z => new Claim(z.Key, z.Value)).ToArray();