Created
December 13, 2016 21:19
-
-
Save samueleresca/c475abd4a6831a23981a55d76223757b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Claims; | |
using System.Threading.Tasks; | |
using Microsoft.IdentityModel.Tokens; | |
namespace CustomTokenAuthProvider | |
{ | |
public class TokenProviderOptions | |
{ | |
/// <summary> | |
/// The relative request path to listen on. | |
/// </summary> | |
/// <remarks>The default path is <c>/token</c>.</remarks> | |
public string Path { get; set; } = "/token"; | |
/// <summary> | |
/// The Issuer (iss) claim for generated tokens. | |
/// </summary> | |
public string Issuer { get; set; } | |
/// <summary> | |
/// The Audience (aud) claim for the generated tokens. | |
/// </summary> | |
public string Audience { get; set; } | |
/// <summary> | |
/// The expiration time for the generated tokens. | |
/// </summary> | |
/// <remarks>The default is five minutes (300 seconds).</remarks> | |
public TimeSpan Expiration { get; set; } = TimeSpan.FromMinutes(5); | |
/// <summary> | |
/// The signing key to use when generating tokens. | |
/// </summary> | |
public SigningCredentials SigningCredentials { get; set; } | |
/// <summary> | |
/// Resolves a user identity given a username and password. | |
/// </summary> | |
public Func<string, string, Task<ClaimsIdentity>> IdentityResolver { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment