files tree made better.
This commit is contained in:
parent
ffbf032480
commit
ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions
57
src/OAuth.AspNet.AuthServer/AuthenticationResponseGrant.cs
Normal file
57
src/OAuth.AspNet.AuthServer/AuthenticationResponseGrant.cs
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
using Microsoft.AspNet.Http.Authentication;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace OAuth.AspNet.AuthServer
|
||||
{
|
||||
/// <summary>
|
||||
/// Exposes the security.SignIn environment value as a strong type.
|
||||
/// </summary>
|
||||
public class AuthenticationResponseGrant
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AuthenticationResponseGrant"/> class.
|
||||
/// </summary>
|
||||
/// <param name="identity"></param>
|
||||
/// <param name="properties"></param>
|
||||
public AuthenticationResponseGrant(ClaimsIdentity identity, AuthenticationProperties properties)
|
||||
{
|
||||
Principal = new ClaimsPrincipal(identity);
|
||||
Identity = identity;
|
||||
Properties = properties;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AuthenticationResponseGrant"/> class.
|
||||
/// </summary>
|
||||
/// <param name="principal"></param>
|
||||
/// <param name="properties"></param>
|
||||
public AuthenticationResponseGrant(ClaimsPrincipal principal, AuthenticationProperties properties)
|
||||
{
|
||||
if (principal == null)
|
||||
{
|
||||
throw new ArgumentNullException("principal");
|
||||
}
|
||||
|
||||
Principal = principal;
|
||||
Identity = principal.Identities.FirstOrDefault();
|
||||
Properties = properties;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The identity associated with the user sign in.
|
||||
/// </summary>
|
||||
public ClaimsIdentity Identity { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The security principal associated with the user sign in.
|
||||
/// </summary>
|
||||
public ClaimsPrincipal Principal { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary used to store state values about the authentication session.
|
||||
/// </summary>
|
||||
public AuthenticationProperties Properties { get; private set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue