diff --git a/src/Umbraco.Core/Extensions/ClaimsIdentityExtensions.cs b/src/Umbraco.Core/Extensions/ClaimsIdentityExtensions.cs index a604b3e0173e..eef48f1d81d1 100644 --- a/src/Umbraco.Core/Extensions/ClaimsIdentityExtensions.cs +++ b/src/Umbraco.Core/Extensions/ClaimsIdentityExtensions.cs @@ -330,7 +330,10 @@ public static string[] GetAllowedApplications(this ClaimsIdentity identity) => i var firstValue = identity.FindFirstValue(ClaimTypes.NameIdentifier); if (firstValue is not null) { - return int.Parse(firstValue, CultureInfo.InvariantCulture); + if (int.TryParse(firstValue, CultureInfo.InvariantCulture, out var id)) + { + return id; + } } return null;