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

## AuthSession Class

Represents a model of an authentication session for a logged\-in user, capturing essential details about the user's
authentication state and interactions within the system\.

```csharp
public record AuthSession : System.IEquatable<Abblix.Oidc.Server.Features.UserAuthentication.AuthSession>
```

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

Implements [System\.IEquatable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')[AuthSession](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Features.UserAuthentication.AuthSession 'Abblix\.Oidc\.Server\.Features\.UserAuthentication\.AuthSession')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')
### Constructors

## AuthSession\(string, string, DateTimeOffset, string\) Constructor {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthSession(string,string,System.DateTimeOffset,string)}

Represents a model of an authentication session for a logged\-in user, capturing essential details about the user's
authentication state and interactions within the system\.

```csharp
public AuthSession(string Subject, string SessionId, System.DateTimeOffset AuthenticationTime, string IdentityProvider);
```
#### Parameters

###### `Subject` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthSession(string,string,System.DateTimeOffset,string).Subject}

###### `SessionId` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthSession(string,string,System.DateTimeOffset,string).SessionId}

###### `AuthenticationTime` [System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset') {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthSession(string,string,System.DateTimeOffset,string).AuthenticationTime}

###### `IdentityProvider` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthSession(string,string,System.DateTimeOffset,string).IdentityProvider}
### Properties

## AuthSession\.AdditionalClaims Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AdditionalClaims}

Additional custom claims to include in the authentication session\.
These claims will be serialized to the authentication cookie and can be included in tokens\.
Supports any JSON value: strings, numbers, booleans, arrays, objects\.

```csharp
public System.Text.Json.Nodes.JsonObject? AdditionalClaims { get; init; }
```

#### Property Value
[System\.Text\.Json\.Nodes\.JsonObject](https://learn.microsoft.com/en-us/dotnet/api/system.text.json.nodes.jsonobject 'System\.Text\.Json\.Nodes\.JsonObject')

### Example

```csharp
AdditionalClaims = new JsonObject
{
    ["tenant_id"] = "tenant-123",                          // string
    ["roles"] = new JsonArray("admin", "user"),            // array
    ["permissions"] = new JsonArray("read", "write"),      // array
    ["is_verified"] = true,                                // boolean
    ["login_count"] = 42,                                  // number
    ["metadata"] = new JsonObject                          // nested object
    {
        ["department"] = "Engineering",
        ["manager"] = "john@example.com"
    }
}
```

## AuthSession\.AffectedClientIds Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AffectedClientIds}

A collection of client identifiers that the user has interacted with during the session\.
This can be used to manage and track user consent and interaction with multiple clients within the same session\.

```csharp
public System.Collections.Generic.ICollection<string> AffectedClientIds { get; init; }
```

#### Property Value
[System\.Collections\.Generic\.ICollection&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1 'System\.Collections\.Generic\.ICollection\`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.icollection-1 'System\.Collections\.Generic\.ICollection\`1')

## AuthSession\.AuthContextClassRef Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthContextClassRef}

Indicates the authentication context class that the authentication performed satisfied, according to
specifications such as SAML 2\.0 or OpenID Connect\. This may dictate the level of assurance provided
by the authentication process\.

```csharp
public string? AuthContextClassRef { get; init; }
```

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

## AuthSession\.AuthenticationMethodReferences Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthenticationMethodReferences}

A list of authentication methods used during the user's authentication process,
represented as Authentication Method Reference \(AMR\) values according to the OpenID Connect specification\.
These values indicate how the user was authenticated, such as using a password, multifactor authentication,
biometric verification, or other supported mechanisms\. This information is useful for auditing,
enforcing authentication policies, or satisfying specific security requirements\.

```csharp
public System.Collections.Generic.ICollection<string>? AuthenticationMethodReferences { get; init; }
```

#### Property Value
[System\.Collections\.Generic\.ICollection&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1 'System\.Collections\.Generic\.ICollection\`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.icollection-1 'System\.Collections\.Generic\.ICollection\`1')

## AuthSession\.AuthenticationTime Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.AuthenticationTime}

The timestamp indicating when the user was authenticated\. This is used for session management purposes such as
session expiration and activity logging\.

```csharp
public System.DateTimeOffset AuthenticationTime { get; init; }
```

#### Property Value
[System\.DateTimeOffset](https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset 'System\.DateTimeOffset')

## AuthSession\.Email Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.Email}

The email address used for authentication\. When specified, this exact email is included in the authentication
cookie and ID token claims, regardless of other emails associated with the user account\.
This ensures external provider emails \(Google, Microsoft\) or challenge emails are preserved exactly as used\.

```csharp
public string? Email { get; init; }
```

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

## AuthSession\.EmailVerified Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.EmailVerified}

Indicates whether the email address has been verified\. When true, the email\_verified claim is set to true
in ID tokens\. This is particularly useful for external providers that verify emails or when email verification
has been completed through challenge flows\.

```csharp
public System.Nullable<bool> EmailVerified { get; init; }
```

#### Property Value
[System\.Nullable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')[System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1 'System\.Nullable\`1')

## AuthSession\.IdentityProvider Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.IdentityProvider}

The provider used to authenticate the user's identity\. This could be a local database, an external identity
provider, or a social login provider, and can be useful for auditing and enforcing security policies based
on the origin of authentication\.

```csharp
public string? IdentityProvider { get; init; }
```

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

## AuthSession\.SessionId Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.SessionId}

The unique identifier of the session, used to track the session across requests and possibly across
different services\.

```csharp
public string SessionId { get; init; }
```

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

## AuthSession\.Subject Property {#Abblix.Oidc.Server.Features.UserAuthentication.AuthSession.Subject}

The unique identifier for the user in the session\. This is typically a user\-specific identifier that can be
used to retrieve user details or verify the user's identity across different parts of the application\.

```csharp
public string Subject { get; init; }
```

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