files tree made better.
This commit is contained in:
parent
ffbf032480
commit
ccc91bbf19
1630 changed files with 18209 additions and 41860 deletions
|
|
@ -0,0 +1,43 @@
|
|||
using Microsoft.AspNet.Http;
|
||||
using Microsoft.AspNet.Authentication;
|
||||
using System;
|
||||
|
||||
namespace OAuth.AspNet.AuthServer
|
||||
{
|
||||
|
||||
public class AuthenticationTokenCreateContext : BaseContext
|
||||
{
|
||||
private readonly ISecureDataFormat<AuthenticationTicket> _secureDataFormat;
|
||||
|
||||
public AuthenticationTokenCreateContext(HttpContext context, ISecureDataFormat<AuthenticationTicket> secureDataFormat, AuthenticationTicket ticket) : base(context)
|
||||
{
|
||||
if (secureDataFormat == null)
|
||||
throw new ArgumentNullException(nameof(secureDataFormat));
|
||||
|
||||
if (ticket == null)
|
||||
throw new ArgumentNullException(nameof(ticket));
|
||||
|
||||
_secureDataFormat = secureDataFormat;
|
||||
|
||||
Ticket = ticket;
|
||||
}
|
||||
|
||||
public string Token { get; protected set; }
|
||||
|
||||
public AuthenticationTicket Ticket { get; protected set; }
|
||||
|
||||
public string SerializeTicket()
|
||||
{
|
||||
return _secureDataFormat.Protect(Ticket);
|
||||
}
|
||||
|
||||
public void SetToken(string tokenValue)
|
||||
{
|
||||
if (tokenValue == null)
|
||||
throw new ArgumentNullException(nameof(tokenValue));
|
||||
|
||||
Token = tokenValue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue