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

## ISubjectTypeConverter Interface

Defines the interface for a service that converts user subject identifiers according to the client's specified
subject type\. This conversion ensures that the subject identifier presented to the client is in the format
that the client expects, based on its configuration\.

```csharp
public interface ISubjectTypeConverter
```

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

### Remarks
The implementation of this interface should support various subject types, such as "public" or "pairwise",
and provide appropriate conversions based on the OpenID Connect specifications\.
### Properties

## ISubjectTypeConverter\.SubjectTypesSupported Property {#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.SubjectTypesSupported}

Lists the subject types that this converter supports\. This typically includes "public" and "pairwise"
among others, depending on the OpenID Connect implementation specifics\.

```csharp
System.Collections.Generic.IEnumerable<string> SubjectTypesSupported { get; }
```

#### Property Value
[System\.Collections\.Generic\.IEnumerable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1 'System\.Collections\.Generic\.IEnumerable\`1')
### Methods

## ISubjectTypeConverter\.Convert\(string, ClientInfo\) Method {#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.Convert(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo)}

Converts the real subject identifier into the client\-facing one based on the client's subject type: a
pairwise client gets a reversible, per\-sector pseudonym; a public client gets the subject unchanged\.

```csharp
string Convert(string subject, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo);
```
#### Parameters

###### `subject` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.Convert(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).subject}

The original subject identifier of the end\-user\.

###### `clientInfo` [ClientInfo](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.ClientInfo 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo') {#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.Convert(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).clientInfo}

Information about the client for which the subject identifier is being transformed\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
The transformed subject identifier suitable for the client's subject type\.

## ISubjectTypeConverter\.ConvertBack\(string, ClientInfo\) Method {#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.ConvertBack(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo)}

Recovers the real subject identifier from the client\-facing one produced by [Convert\(string, ClientInfo\)](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.Convert(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo) 'Abblix\.Oidc\.Server\.Features\.PairwiseIdentifiers\.ISubjectTypeConverter\.Convert\(string, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo\)'): a
pairwise client's pseudonym is opened back to the real subject; a public client's subject is returned
unchanged\. The [clientInfo](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.ConvertBack(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).clientInfo 'Abblix\.Oidc\.Server\.Features\.PairwiseIdentifiers\.ISubjectTypeConverter\.ConvertBack\(string, Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo\)\.clientInfo') must be the client the subject was sealed for, as its sector
binds the pseudonym\.

```csharp
string? ConvertBack(string subject, Abblix.Oidc.Server.Features.ClientInformation.ClientInfo clientInfo);
```
#### Parameters

###### `subject` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.ConvertBack(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).subject}

The client\-facing subject identifier \(pairwise pseudonym or real subject\)\.

###### `clientInfo` [ClientInfo](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.ClientInformation.ClientInfo 'Abblix\.Oidc\.Server\.Features\.ClientInformation\.ClientInfo') {#Abblix.Oidc.Server.Features.PairwiseIdentifiers.ISubjectTypeConverter.ConvertBack(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).clientInfo}

The client the subject was issued for\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
The real subject identifier, or `null` when a pairwise pseudonym cannot be opened \(malformed,
            sealed for a different sector, or produced under a different pairwise salt\) so the caller can reject the
            token at the protocol level\.

#### Exceptions

[System\.InvalidOperationException](https://learn.microsoft.com/en-us/dotnet/api/system.invalidoperationexception 'System\.InvalidOperationException')  
Thrown only when pairwise identifiers are not configured
            but a pairwise client is asked to recover, which is a server misconfiguration rather than a bad token\.
