bill
This commit is contained in:
parent
08606c106b
commit
a120dae977
144 changed files with 10574 additions and 1527 deletions
40
Yavsc/AuthorizationServer/AuthServer/DefaultBehavior.cs
Normal file
40
Yavsc/AuthorizationServer/AuthServer/DefaultBehavior.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OAuth.AspNet.AuthServer
|
||||
{
|
||||
|
||||
internal static class DefaultBehavior
|
||||
{
|
||||
internal static readonly Func<OAuthValidateAuthorizeRequestContext, Task> ValidateAuthorizeRequest = context =>
|
||||
{
|
||||
context.Validated();
|
||||
return Task.FromResult<object>(null);
|
||||
};
|
||||
|
||||
internal static readonly Func<OAuthValidateTokenRequestContext, Task> ValidateTokenRequest = context =>
|
||||
{
|
||||
context.Validated();
|
||||
return Task.FromResult<object>(null);
|
||||
};
|
||||
|
||||
internal static readonly Func<OAuthGrantAuthorizationCodeContext, Task> GrantAuthorizationCode = context =>
|
||||
{
|
||||
if (context.Ticket != null && context.Ticket.Principal != null && context.Ticket.Principal.Identity.IsAuthenticated)
|
||||
{
|
||||
context.Validated();
|
||||
}
|
||||
return Task.FromResult<object>(null);
|
||||
};
|
||||
|
||||
internal static readonly Func<OAuthGrantRefreshTokenContext, Task> GrantRefreshToken = context =>
|
||||
{
|
||||
if (context.Ticket != null && context.Ticket.Principal != null && context.Ticket.Principal.Identity.IsAuthenticated)
|
||||
{
|
||||
context.Validated();
|
||||
}
|
||||
return Task.FromResult<object>(null);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue