-
Notifications
You must be signed in to change notification settings - Fork 11
/
PasswordlessAspNetCoreOptions.cs
37 lines (33 loc) · 1.62 KB
/
PasswordlessAspNetCoreOptions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Diagnostics;
using System.Security.Claims;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
namespace Passwordless.AspNetCore;
/// <summary>
/// Represents all the options you can use to configure Passwordless in your ASP.NET Core application.
/// </summary>
[DebuggerDisplay("SignInScheme = {SignInScheme}, UserIdClaimType = {UserIdClaimType}")]
public class PasswordlessAspNetCoreOptions : PasswordlessOptions
{
/// <summary>
/// Controls the scheme that will be used to handle the sign in, fallsback to using <see cref="AuthenticationOptions.DefaultSignInScheme" />
/// that can be configured during <c>AddAuthentication</c> and if that is null will fallback to <see cref="AuthenticationOptions.DefaultScheme" />.
/// </summary>
/// <remarks>
/// Defaults to <see langword="null" />
/// </remarks>
public string? SignInScheme { get; set; }
/// <summary>
/// Controls the claim type that will be used to find the user id from an authenticated users <see cref="ClaimsPrincipal" />
/// if it is null it will fallback to <see cref="ClaimsIdentityOptions.UserIdClaimType" /> from <see cref="IdentityOptions.ClaimsIdentity" />
/// and if that is null will fallback to <see cref="ClaimTypes.NameIdentifier" />.
/// </summary>
/// <remarks>
/// Defaults to <see langword="null" />
/// </remarks>
public string? UserIdClaimType { get; set; }
/// <summary>
/// Gets or sets the <see cref="PasswordlessRegisterOptions"/> for the Passwordless system.
/// </summary>
public PasswordlessRegisterOptions Register { get; set; } = new();
}