#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Features\.TokenExchange](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange 'Abblix\.Oidc\.Server\.Features\.TokenExchange')

## JwtSubjectTokenResolver Class

[ISubjectTokenResolver](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.ISubjectTokenResolver') for JWT\-formatted subject tokens\. Validates the JWT via
            [IAuthServiceJwtValidator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Validation.IAuthServiceJwtValidator 'Abblix\.Oidc\.Server\.Features\.Tokens\.Validation\.IAuthServiceJwtValidator') \(signature, lifetime, registered claims\) and projects
            the payload's `sub`, `scope`, and `authorization_details` claims into a
            [SubjectTokenContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.SubjectTokenContext 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.SubjectTokenContext')\.

```csharp
public sealed class JwtSubjectTokenResolver : Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → JwtSubjectTokenResolver

Implements [ISubjectTokenResolver](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.ISubjectTokenResolver')

### Remarks
Used for three RFC 8693 token\-type URIs that share the JWT validation path:
[AccessToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes#Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes.AccessToken 'Abblix\.Oidc\.Server\.Common\.Constants\.TokenExchangeTokenTypes\.AccessToken'), [IdToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes#Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes.IdToken 'Abblix\.Oidc\.Server\.Common\.Constants\.TokenExchangeTokenTypes\.IdToken'),
and [Jwt](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes#Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes.Jwt 'Abblix\.Oidc\.Server\.Common\.Constants\.TokenExchangeTokenTypes\.Jwt')\. The same instance is registered under all three
keyed\-DI keys \(see `AddTokenExchangeGrant`\); the [System\.Type](https://learn.microsoft.com/en-us/dotnet/api/system.type 'System\.Type') property reports the
instance's primary key so dispatch logging stays readable\.
### Constructors

## JwtSubjectTokenResolver\(IAuthServiceJwtValidator\) Constructor {#Abblix.Oidc.Server.Features.TokenExchange.JwtSubjectTokenResolver.JwtSubjectTokenResolver(Abblix.Oidc.Server.Features.Tokens.Validation.IAuthServiceJwtValidator)}

[ISubjectTokenResolver](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.ISubjectTokenResolver') for JWT\-formatted subject tokens\. Validates the JWT via
            [IAuthServiceJwtValidator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Validation.IAuthServiceJwtValidator 'Abblix\.Oidc\.Server\.Features\.Tokens\.Validation\.IAuthServiceJwtValidator') \(signature, lifetime, registered claims\) and projects
            the payload's `sub`, `scope`, and `authorization_details` claims into a
            [SubjectTokenContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.SubjectTokenContext 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.SubjectTokenContext')\.

```csharp
public JwtSubjectTokenResolver(Abblix.Oidc.Server.Features.Tokens.Validation.IAuthServiceJwtValidator jwtValidator);
```
#### Parameters

###### `jwtValidator` [IAuthServiceJwtValidator](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Validation.IAuthServiceJwtValidator 'Abblix\.Oidc\.Server\.Features\.Tokens\.Validation\.IAuthServiceJwtValidator') {#Abblix.Oidc.Server.Features.TokenExchange.JwtSubjectTokenResolver.JwtSubjectTokenResolver(Abblix.Oidc.Server.Features.Tokens.Validation.IAuthServiceJwtValidator).jwtValidator}

Validates own\-issued JWTs \(signature against AS keys, claims\)\.

### Remarks
Used for three RFC 8693 token\-type URIs that share the JWT validation path:
[AccessToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes#Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes.AccessToken 'Abblix\.Oidc\.Server\.Common\.Constants\.TokenExchangeTokenTypes\.AccessToken'), [IdToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes#Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes.IdToken 'Abblix\.Oidc\.Server\.Common\.Constants\.TokenExchangeTokenTypes\.IdToken'),
and [Jwt](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes#Abblix.Oidc.Server.Common.Constants.TokenExchangeTokenTypes.Jwt 'Abblix\.Oidc\.Server\.Common\.Constants\.TokenExchangeTokenTypes\.Jwt')\. The same instance is registered under all three
keyed\-DI keys \(see `AddTokenExchangeGrant`\); the [System\.Type](https://learn.microsoft.com/en-us/dotnet/api/system.type 'System\.Type') property reports the
instance's primary key so dispatch logging stays readable\.
### Methods

## JwtSubjectTokenResolver\.ResolveAsync\(string, CancellationToken\) Method {#Abblix.Oidc.Server.Features.TokenExchange.JwtSubjectTokenResolver.ResolveAsync(string,System.Threading.CancellationToken)}

Parses or looks up the wire\-level [subjectToken](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.JwtSubjectTokenResolver#Abblix.Oidc.Server.Features.TokenExchange.JwtSubjectTokenResolver.ResolveAsync(string,System.Threading.CancellationToken).subjectToken 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.JwtSubjectTokenResolver\.ResolveAsync\(string, System\.Threading\.CancellationToken\)\.subjectToken') and returns the
portable subject context on success, or an [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') on failure\.

```csharp
public System.Threading.Tasks.Task<Abblix.Utils.Result<Abblix.Oidc.Server.Features.TokenExchange.SubjectTokenContext,Abblix.Oidc.Server.Common.OidcError>> ResolveAsync(string subjectToken, System.Threading.CancellationToken cancellationToken);
```
#### Parameters

###### `subjectToken` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.TokenExchange.JwtSubjectTokenResolver.ResolveAsync(string,System.Threading.CancellationToken).subjectToken}

The exact `subject_token` string from the wire\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Oidc.Server.Features.TokenExchange.JwtSubjectTokenResolver.ResolveAsync(string,System.Threading.CancellationToken).cancellationToken}

Cancellation token\.

Implements [ResolveAsync\(string, CancellationToken\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver#Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver.ResolveAsync(string,System.Threading.CancellationToken) 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.ISubjectTokenResolver\.ResolveAsync\(string, System\.Threading\.CancellationToken\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Abblix\.Utils\.Result&lt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[SubjectTokenContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.SubjectTokenContext 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.SubjectTokenContext')[,](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/abblix.utils.result-2 'Abblix\.Utils\.Result\`2')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
The resolved subject context on success; an OIDC error describing the
            rejection reason on failure\. The handler maps every failure to wire\-level
            `invalid_request` per RFC 8693 §2\.2\.2\.
