|
|
|
@ -510,7 +510,7 @@ public static class OpenIddictExtensions |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(destinations)) |
|
|
|
{ |
|
|
|
return ImmutableArray.Create<string>(); |
|
|
|
return []; |
|
|
|
} |
|
|
|
|
|
|
|
using var document = JsonDocument.Parse(destinations); |
|
|
|
@ -620,7 +620,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="claim">The <see cref="Claim"/> instance.</param>
|
|
|
|
/// <param name="destinations">The destinations.</param>
|
|
|
|
public static Claim SetDestinations(this Claim claim, IEnumerable<string>? destinations) |
|
|
|
=> claim.SetDestinations(destinations?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> claim.SetDestinations(destinations?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Adds specific destinations to a claim.
|
|
|
|
@ -628,7 +628,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="claim">The <see cref="Claim"/> instance.</param>
|
|
|
|
/// <param name="destinations">The destinations.</param>
|
|
|
|
public static Claim SetDestinations(this Claim claim, params string[]? destinations) |
|
|
|
=> claim.SetDestinations(destinations?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> claim.SetDestinations(destinations?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the destinations associated with all the claims of the given identity.
|
|
|
|
@ -2810,7 +2810,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="audiences">The audiences to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetAudiences(this ClaimsIdentity identity, IEnumerable<string>? audiences) |
|
|
|
=> identity.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetAudiences(audiences?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the audiences list in the claims principal.
|
|
|
|
@ -2820,7 +2820,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="audiences">The audiences to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetAudiences(this ClaimsPrincipal principal, IEnumerable<string>? audiences) |
|
|
|
=> principal.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetAudiences(audiences?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the audiences list in the claims identity.
|
|
|
|
@ -2830,7 +2830,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="audiences">The audiences to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetAudiences(this ClaimsIdentity identity, params string[]? audiences) |
|
|
|
=> identity.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetAudiences(audiences?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the audiences list in the claims principal.
|
|
|
|
@ -2840,7 +2840,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="audiences">The audiences to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetAudiences(this ClaimsPrincipal principal, params string[]? audiences) |
|
|
|
=> principal.SetAudiences(audiences?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetAudiences(audiences?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the presenters list in the claims identity.
|
|
|
|
@ -2870,7 +2870,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="presenters">The presenters to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetPresenters(this ClaimsIdentity identity, IEnumerable<string>? presenters) |
|
|
|
=> identity.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetPresenters(presenters?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the presenters list in the claims principal.
|
|
|
|
@ -2880,7 +2880,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="presenters">The presenters to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetPresenters(this ClaimsPrincipal principal, IEnumerable<string>? presenters) |
|
|
|
=> principal.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetPresenters(presenters?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the presenters list in the claims identity.
|
|
|
|
@ -2890,7 +2890,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="presenters">The presenters to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetPresenters(this ClaimsIdentity identity, params string[]? presenters) |
|
|
|
=> identity.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetPresenters(presenters?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the presenters list in the claims principal.
|
|
|
|
@ -2900,7 +2900,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="presenters">The presenters to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetPresenters(this ClaimsPrincipal principal, params string[]? presenters) |
|
|
|
=> principal.SetPresenters(presenters?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetPresenters(presenters?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the resources list in the claims identity.
|
|
|
|
@ -2930,7 +2930,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="resources">The resources to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetResources(this ClaimsIdentity identity, IEnumerable<string>? resources) |
|
|
|
=> identity.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetResources(resources?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the resources list in the claims principal.
|
|
|
|
@ -2940,7 +2940,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="resources">The resources to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetResources(this ClaimsPrincipal principal, IEnumerable<string>? resources) |
|
|
|
=> principal.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetResources(resources?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the resources list in the claims identity.
|
|
|
|
@ -2950,7 +2950,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="resources">The resources to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetResources(this ClaimsIdentity identity, params string[]? resources) |
|
|
|
=> identity.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetResources(resources?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the resources list in the claims principal.
|
|
|
|
@ -2960,7 +2960,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="resources">The resources to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetResources(this ClaimsPrincipal principal, params string[]? resources) |
|
|
|
=> principal.SetResources(resources?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetResources(resources?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the scopes list in the claims identity.
|
|
|
|
@ -2990,7 +2990,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="scopes">The scopes to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetScopes(this ClaimsIdentity identity, IEnumerable<string>? scopes) |
|
|
|
=> identity.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetScopes(scopes?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the scopes list in the claims principal.
|
|
|
|
@ -3000,7 +3000,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="scopes">The scopes to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetScopes(this ClaimsPrincipal principal, IEnumerable<string>? scopes) |
|
|
|
=> principal.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetScopes(scopes?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the scopes list in the claims identity.
|
|
|
|
@ -3010,7 +3010,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="scopes">The scopes to store.</param>
|
|
|
|
/// <returns>The claims identity.</returns>
|
|
|
|
public static ClaimsIdentity SetScopes(this ClaimsIdentity identity, params string[]? scopes) |
|
|
|
=> identity.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> identity.SetScopes(scopes?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the scopes list in the claims principal.
|
|
|
|
@ -3020,7 +3020,7 @@ public static class OpenIddictExtensions |
|
|
|
/// <param name="scopes">The scopes to store.</param>
|
|
|
|
/// <returns>The claims principal.</returns>
|
|
|
|
public static ClaimsPrincipal SetScopes(this ClaimsPrincipal principal, params string[]? scopes) |
|
|
|
=> principal.SetScopes(scopes?.ToImmutableArray() ?? ImmutableArray.Create<string>()); |
|
|
|
=> principal.SetScopes(scopes?.ToImmutableArray() ?? []); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sets the access token lifetime associated with the claims identity.
|
|
|
|
@ -3208,7 +3208,7 @@ public static class OpenIddictExtensions |
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(source)) |
|
|
|
{ |
|
|
|
return ImmutableArray.Create<string>(); |
|
|
|
return []; |
|
|
|
} |
|
|
|
|
|
|
|
var builder = ImmutableArray.CreateBuilder<string>(); |
|
|
|
|