Skip to content

ServiceJwtEncryptionExtensions Class

Completes a ServiceJwtEncryption policy from the request it is about to serve.

C#
public static class ServiceJwtEncryptionExtensions

Inheritance System.Object → ServiceJwtEncryptionExtensions

Methods

ServiceJwtEncryptionExtensions.WithAudienceKeyAsync(this ServiceJwtEncryption, AuthorizationContext, IAudienceKeyResolver) Method

Points the policy at the key published by the resource this token was minted for, so the party named in aud can read it.

C#
public static System.Threading.Tasks.Task<Abblix.Oidc.Server.Features.Tokens.Formatters.ServiceJwtEncryption> WithAudienceKeyAsync(this Abblix.Oidc.Server.Features.Tokens.Formatters.ServiceJwtEncryption encryption, Abblix.Oidc.Server.Common.AuthorizationContext context, Abblix.Oidc.Server.Features.ResourceIndicators.IAudienceKeyResolver audienceKeys);

Parameters

encryption ServiceJwtEncryption

The policy projected from the server's own settings.

context AuthorizationContext

The authorization context naming the token's audience.

audienceKeys IAudienceKeyResolver

Answers which key, if any, the named audience published.

Returns

System.Threading.Tasks.Task<ServiceJwtEncryption>
The policy, pointed at the audience's key where one is published.

Remarks

An audience that publishes no key leaves the policy untouched, which is how it says a signed JWS is what it expects. What makes a set of resources publish one key or none is IAudienceKeyResolver's question.