This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 865
/
TokenOptions.cs
84 lines (72 loc) · 3.7 KB
/
TokenOptions.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
namespace Microsoft.AspNetCore.Identity
{
/// <summary>
/// Options for user tokens.
/// </summary>
public class TokenOptions
{
/// <summary>
/// Default token provider name used by email confirmation, password reset, and change email.
/// </summary>
public static readonly string DefaultProvider = "Default";
/// <summary>
/// Default token provider name used by the email provider. />.
/// </summary>
public static readonly string DefaultEmailProvider = "Email";
/// <summary>
/// Default token provider name used by the phone provider. />.
/// </summary>
public static readonly string DefaultPhoneProvider = "Phone";
/// <summary>
/// Default token provider name used by the <see cref="AuthenticatorTokenProvider"/>.
/// </summary>
public static readonly string DefaultAuthenticatorProvider = "Authenticator";
/// <summary>
/// Will be used to construct UserTokenProviders with the key used as the providerName.
/// </summary>
public Dictionary<string, TokenProviderDescriptor> ProviderMap { get; set; } = new Dictionary<string, TokenProviderDescriptor>();
/// <summary>
/// Gets or sets the token provider used to generate tokens used in account confirmation emails.
/// </summary>
/// <value>
/// The <see cref="IUserTwoFactorTokenProvider{TUser}"/> used to generate tokens used in account confirmation emails.
/// </value>
public string EmailConfirmationTokenProvider { get; set; } = DefaultProvider;
/// <summary>
/// Gets or sets the <see cref="IUserTwoFactorTokenProvider{TUser}"/> used to generate tokens used in password reset emails.
/// </summary>
/// <value>
/// The <see cref="IUserTwoFactorTokenProvider{TUser}"/> used to generate tokens used in password reset emails.
/// </value>
public string PasswordResetTokenProvider { get; set; } = DefaultProvider;
/// <summary>
/// Gets or sets the <see cref="ChangeEmailTokenProvider"/> used to generate tokens used in email change confirmation emails.
/// </summary>
/// <value>
/// The <see cref="ChangeEmailTokenProvider"/> used to generate tokens used in email change confirmation emails.
/// </value>
public string ChangeEmailTokenProvider { get; set; } = DefaultProvider;
/// <summary>
/// Gets or sets the <see cref="ChangePhoneNumberTokenProvider"/> used to generate tokens used when changing phone numbers.
/// </summary>
/// <value>
/// The <see cref="ChangePhoneNumberTokenProvider"/> used to generate tokens used when changing phone numbers.
/// </value>
public string ChangePhoneNumberTokenProvider { get; set; } = DefaultPhoneProvider;
/// <summary>
/// Gets or sets the <see cref="AuthenticatorTokenProvider"/> used to validate two factor sign ins with an authenticator.
/// </summary>
/// <value>
/// The <see cref="AuthenticatorTokenProvider"/> used to validate two factor sign ins with an authenticator.
/// </value>
public string AuthenticatorTokenProvider { get; set; } = DefaultAuthenticatorProvider;
/// <summary>
/// Gets or sets the issuer used for the authenticator issuer.
/// </summary>
public string AuthenticatorIssuer { get; set; } = "Microsoft.AspNetCore.Identity.UI";
}
}