mirror of
https://github.com/tomasvarg/OwinWebApiTest.git
synced 2026-03-01 08:28:49 +00:00
20 lines
675 B
C#
20 lines
675 B
C#
using Microsoft.Owin.Security.OAuth;
|
|
using System.Security.Claims;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace OwinWebApiTest.Providers
|
|
{
|
|
public class SimpleAuthorizationServerProvider : OAuthAuthorizationServerProvider
|
|
{
|
|
public override async Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context)
|
|
{
|
|
await Task.FromResult(context.Validated());
|
|
}
|
|
|
|
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
|
|
{
|
|
await Task.FromResult(context.Validated(new ClaimsIdentity(context.Options.AuthenticationType)));
|
|
}
|
|
|
|
}
|
|
} |