#### [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')

## ISubjectTokenResolver Interface

Resolves a wire\-level `subject_token` of a specific RFC 8693 §3 token type into a
portable [SubjectTokenContext](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.TokenExchange.SubjectTokenContext 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.SubjectTokenContext')\. One resolver per supported token type URI,
registered with keyed DI under the URI as key; the
[TokenExchangeGrantHandler](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Grants.TokenExchangeGrantHandler 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Grants\.TokenExchangeGrantHandler') dispatches by reading the
request's `subject_token_type` as the lookup key\.

```csharp
public interface ISubjectTokenResolver
```

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

### Remarks
The library ships resolvers for `urn:ietf:params:oauth:token-type:access_token`,
`:id_token`, `:jwt` \(all backed by JWT validation\), and `:refresh_token`
\(backed by storage lookup\)\. Hosts may register additional resolvers for token types this
library does not handle natively, e\.g\. SAML 2\.0 assertions in federated scenarios \-\- the
handler picks them up automatically\.

Lookup that returns no resolver for the requested key yields
`invalid_request` at the handler level -- the library never silently accepts an
unknown subject_token_type.
### Methods

## ISubjectTokenResolver\.ResolveAsync\(string, CancellationToken\) Method {#Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver.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.ISubjectTokenResolver#Abblix.Oidc.Server.Features.TokenExchange.ISubjectTokenResolver.ResolveAsync(string,System.Threading.CancellationToken).subjectToken 'Abblix\.Oidc\.Server\.Features\.TokenExchange\.ISubjectTokenResolver\.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
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.ISubjectTokenResolver.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.ISubjectTokenResolver.ResolveAsync(string,System.Threading.CancellationToken).cancellationToken}

Cancellation token\.

#### 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\.
