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

## SubjectTypeConverter Class

Implements conversion of subject identifiers for end\-users based on the subject type requested by the client\.
Uses HMAC\-SHA256 with a server\-side secret salt for pairwise identifiers, per OpenID Connect Core Section 8\.1\.

```csharp
public class SubjectTypeConverter : Abblix.Oidc.Server.Features.UserInfo.ISubjectTypeConverter
```

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

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

## SubjectTypeConverter\(PairwiseSubjectSettings\) Constructor {#Abblix.Oidc.Server.Features.UserInfo.SubjectTypeConverter.SubjectTypeConverter(Abblix.Oidc.Server.Features.UserInfo.PairwiseSubjectSettings)}

Implements conversion of subject identifiers for end\-users based on the subject type requested by the client\.
Uses HMAC\-SHA256 with a server\-side secret salt for pairwise identifiers, per OpenID Connect Core Section 8\.1\.

```csharp
public SubjectTypeConverter(Abblix.Oidc.Server.Features.UserInfo.PairwiseSubjectSettings? settings=null);
```
#### Parameters

###### `settings` [PairwiseSubjectSettings](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.UserInfo.PairwiseSubjectSettings 'Abblix\.Oidc\.Server\.Features\.UserInfo\.PairwiseSubjectSettings') {#Abblix.Oidc.Server.Features.UserInfo.SubjectTypeConverter.SubjectTypeConverter(Abblix.Oidc.Server.Features.UserInfo.PairwiseSubjectSettings).settings}
### Properties

## SubjectTypeConverter\.SubjectTypesSupported Property {#Abblix.Oidc.Server.Features.UserInfo.SubjectTypeConverter.SubjectTypesSupported}

The two OIDC Core §8 subject types this converter implements: `public` \(passes the local
subject through unchanged\) and `pairwise` \(HMAC\-derived per\-sector identifier\)\.

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

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

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

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

Converts the subject identifier based on the client's subject type\.
For pairwise: HMAC\(salt, UrlEncode\(sector\) \+ "&" \+ UrlEncode\(subject\)\) → base64url\.
The HMAC algorithm is configurable via PairwiseSubjectSettings\.HashAlgorithm \(default: SHA256\)\.
For public: returns the original subject identifier unchanged\.

```csharp
public 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.UserInfo.SubjectTypeConverter.Convert(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).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.UserInfo.SubjectTypeConverter.Convert(string,Abblix.Oidc.Server.Features.ClientInformation.ClientInfo).clientInfo}

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

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')
