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

## TenantSecurityEventTokenSigner Class

Signs a security event token with a signing key of the tenant serving the request, so a receiver verifies what a
tenant transmits with that tenant's published keys alone\.

```csharp
public sealed class TenantSecurityEventTokenSigner : Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner
```

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

Implements [ISecurityEventTokenSigner](https://www.abblix.com/docs/api/abblix-securityevents/Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner 'Abblix\.SecurityEvents\.Abstractions\.ISecurityEventTokenSigner')

### Remarks
The key is the tenant's first signing key that performs an algorithm [Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantSecurityEventTokenSigner\.AlgorithmsFor\(Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements,Abblix\.SecurityEvents\.Infrastructure\.SecurityEventsOptions\)](https://learn.microsoft.com/en-us/dotnet/api/abblix.oidc.server.features.multitenancy.tenantsecurityeventtokensigner.algorithmsfor#abblix-oidc-server-features-multitenancy-tenantsecurityeventtokensigner-algorithmsfor(abblix-oidc-server-features-clientinformation-securityprofilerequirements-abblix-securityevents-infrastructure-securityeventsoptions) 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantSecurityEventTokenSigner\.AlgorithmsFor\(Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements,Abblix\.SecurityEvents\.Infrastructure\.SecurityEventsOptions\)') names: one the
deployment allows \([AllowedSigningAlgorithms](https://www.abblix.com/docs/api/abblix-securityevents/Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions#Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions.AllowedSigningAlgorithms 'Abblix\.SecurityEvents\.Infrastructure\.SecurityEventsOptions\.AllowedSigningAlgorithms')\) and the tenant's security profile
permits, or, where the deployment sets no allowlist, one the profile admits in place of the RS256 that stands for:
FAPI 1\.0 Part 2 section 8\.6, "For JWS, both clients and authorization servers shall use PS256 or ES256 algorithms",
and FAPI 2\.0 section 5\.4\.1, "Authorization servers, clients, and resource servers when creating or processing JWTs
shall \.\.\. use PS256, ES256, or EdDSA \(using the Ed25519 variant\) algorithms"\. The profile is the tenant's own: a
stream names its receiver by the identifier its credentials carry, not by a client of the tenant, so no client's
profile is in force for what it is sent\. Where no key qualifies the token is not signed at all, so a tenant held to
a profile never sends one under an algorithm the profile refuses\. A host transmitting security events registers
this signer in place of the one `AddSecurityEvents` registers; startup refuses any other\.
### Constructors

## TenantSecurityEventTokenSigner\(IAuthServiceKeysProvider, ProfiledJwtIssuer, IOptions\<SecurityEventsOptions\>, ITenantAccessor, SigningAlgorithmsProvider\) Constructor {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.TenantSecurityEventTokenSigner(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Microsoft.Extensions.Options.IOptions_Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions_,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Jwt.SigningAlgorithmsProvider)}

Signs a security event token with a signing key of the tenant serving the request, so a receiver verifies what a
tenant transmits with that tenant's published keys alone\.

```csharp
public TenantSecurityEventTokenSigner(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider keys, Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer issuer, Microsoft.Extensions.Options.IOptions<Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions> options, Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor tenantAccessor, Abblix.Jwt.SigningAlgorithmsProvider signingAlgorithms);
```
#### Parameters

###### `keys` [IAuthServiceKeysProvider](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider 'Abblix\.Oidc\.Server\.Common\.Interfaces\.IAuthServiceKeysProvider') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.TenantSecurityEventTokenSigner(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Microsoft.Extensions.Options.IOptions_Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions_,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Jwt.SigningAlgorithmsProvider).keys}

The signing keys of the tenant serving the request\.

###### `issuer` [ProfiledJwtIssuer](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer 'Abblix\.Oidc\.Server\.Features\.Tokens\.Formatters\.ProfiledJwtIssuer') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.TenantSecurityEventTokenSigner(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Microsoft.Extensions.Options.IOptions_Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions_,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Jwt.SigningAlgorithmsProvider).issuer}

Signs the token once the tenant's profile admits its algorithm\.

###### `options` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[SecurityEventsOptions](https://www.abblix.com/docs/api/abblix-securityevents/Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions 'Abblix\.SecurityEvents\.Infrastructure\.SecurityEventsOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.TenantSecurityEventTokenSigner(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Microsoft.Extensions.Options.IOptions_Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions_,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Jwt.SigningAlgorithmsProvider).options}

What the deployment allows to sign with\.

###### `tenantAccessor` [ITenantAccessor](https://www.abblix.com/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.ITenantAccessor') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.TenantSecurityEventTokenSigner(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Microsoft.Extensions.Options.IOptions_Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions_,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Jwt.SigningAlgorithmsProvider).tenantAccessor}

Names the tenant the request is served at\.

###### `signingAlgorithms` [SigningAlgorithmsProvider](https://www.abblix.com/docs/api/abblix-jwt/Abblix.Jwt.SigningAlgorithmsProvider 'Abblix\.Jwt\.SigningAlgorithmsProvider') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.TenantSecurityEventTokenSigner(Abblix.Oidc.Server.Common.Interfaces.IAuthServiceKeysProvider,Abblix.Oidc.Server.Features.Tokens.Formatters.ProfiledJwtIssuer,Microsoft.Extensions.Options.IOptions_Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions_,Abblix.Oidc.Server.Features.MultiTenancy.ITenantAccessor,Abblix.Jwt.SigningAlgorithmsProvider).signingAlgorithms}

Tells which algorithms a key signs with\.

### Remarks
The key is the tenant's first signing key that performs an algorithm [Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantSecurityEventTokenSigner\.AlgorithmsFor\(Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements,Abblix\.SecurityEvents\.Infrastructure\.SecurityEventsOptions\)](https://learn.microsoft.com/en-us/dotnet/api/abblix.oidc.server.features.multitenancy.tenantsecurityeventtokensigner.algorithmsfor#abblix-oidc-server-features-multitenancy-tenantsecurityeventtokensigner-algorithmsfor(abblix-oidc-server-features-clientinformation-securityprofilerequirements-abblix-securityevents-infrastructure-securityeventsoptions) 'Abblix\.Oidc\.Server\.Features\.MultiTenancy\.TenantSecurityEventTokenSigner\.AlgorithmsFor\(Abblix\.Oidc\.Server\.Features\.ClientInformation\.SecurityProfileRequirements,Abblix\.SecurityEvents\.Infrastructure\.SecurityEventsOptions\)') names: one the
deployment allows \([AllowedSigningAlgorithms](https://www.abblix.com/docs/api/abblix-securityevents/Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions#Abblix.SecurityEvents.Infrastructure.SecurityEventsOptions.AllowedSigningAlgorithms 'Abblix\.SecurityEvents\.Infrastructure\.SecurityEventsOptions\.AllowedSigningAlgorithms')\) and the tenant's security profile
permits, or, where the deployment sets no allowlist, one the profile admits in place of the RS256 that stands for:
FAPI 1\.0 Part 2 section 8\.6, "For JWS, both clients and authorization servers shall use PS256 or ES256 algorithms",
and FAPI 2\.0 section 5\.4\.1, "Authorization servers, clients, and resource servers when creating or processing JWTs
shall \.\.\. use PS256, ES256, or EdDSA \(using the Ed25519 variant\) algorithms"\. The profile is the tenant's own: a
stream names its receiver by the identifier its credentials carry, not by a client of the tenant, so no client's
profile is in force for what it is sent\. Where no key qualifies the token is not signed at all, so a tenant held to
a profile never sends one under an algorithm the profile refuses\. A host transmitting security events registers
this signer in place of the one `AddSecurityEvents` registers; startup refuses any other\.
### Methods

## TenantSecurityEventTokenSigner\.SignAsync\(SecurityEventToken, CancellationToken\) Method {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken)}

Signs the SET and returns its compact serialization\.

```csharp
public System.Threading.Tasks.Task<string> SignAsync(Abblix.SecurityEvents.SecurityEventToken token, System.Threading.CancellationToken cancellationToken=default(System.Threading.CancellationToken));
```
#### Parameters

###### `token` [SecurityEventToken](https://www.abblix.com/docs/api/abblix-securityevents/Abblix.SecurityEvents.SecurityEventToken 'Abblix\.SecurityEvents\.SecurityEventToken') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken).token}

The SET to sign\.

###### `cancellationToken` [System\.Threading\.CancellationToken](https://learn.microsoft.com/en-us/dotnet/api/system.threading.cancellationtoken 'System\.Threading\.CancellationToken') {#Abblix.Oidc.Server.Features.MultiTenancy.TenantSecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken).cancellationToken}

Cancels key retrieval or remote signing mid\-flight\.

Implements [SignAsync\(SecurityEventToken, CancellationToken\)](https://www.abblix.com/docs/api/abblix-securityevents/Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner#Abblix.SecurityEvents.Abstractions.ISecurityEventTokenSigner.SignAsync(Abblix.SecurityEvents.SecurityEventToken,System.Threading.CancellationToken) 'Abblix\.SecurityEvents\.Abstractions\.ISecurityEventTokenSigner\.SignAsync\(Abblix\.SecurityEvents\.SecurityEventToken,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')[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
The compact JWS \(or JWE\-wrapped JWS\) representation of the SET\.
