File: PasskeyAttestationContext.cs
Web Access
Project: src\src\Identity\Core\src\Microsoft.AspNetCore.Identity.csproj (Microsoft.AspNetCore.Identity)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
 
using Microsoft.AspNetCore.Http;
 
namespace Microsoft.AspNetCore.Identity;
 
/// <summary>
/// Represents the context for passkey attestation.
/// </summary>
/// <typeparam name="TUser">The type of user associated with the passkey.</typeparam>
public sealed class PasskeyAttestationContext<TUser>
    where TUser : class
{
    /// <summary>
    /// Gets or sets the credentials obtained by JSON-serializing the result of the
    /// <c>navigator.credentials.create()</c> JavaScript function.
    /// </summary>
    public required string CredentialJson { get; init; }
 
    /// <summary>
    /// Gets or sets the JSON representation of the original passkey creation options provided to the browser.
    /// </summary>
    public required string OriginalOptionsJson { get; init; }
 
    /// <summary>
    /// Gets or sets the <see cref="UserManager{TUser}"/> to retrieve user information from.
    /// </summary>
    public required UserManager<TUser> UserManager { get; init; }
 
    /// <summary>
    /// Gets or sets the <see cref="HttpContext"/> for the current request. 
    /// </summary>
    public required HttpContext HttpContext { get; init; }
}