Skip to content

Instantly share code, notes, and snippets.

Created July 1, 2014 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8a0079b705423b406c00 to your computer and use it in GitHub Desktop.
Save anonymous/8a0079b705423b406c00 to your computer and use it in GitHub Desktop.
public class SampleAuthProvider : OAuthAuthorizationServerProvider
{
private static readonly ILogger logger = LoggerFactory.Default.Create(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString());
public SampleAuthProvider()
: base()
{
OnGrantResourceOwnerCredentials = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnGrantClientCredentials = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnMatchEndpoint = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.MatchesTokenEndpoint();
return Task.FromResult<object>(null);
};
OnValidateAuthorizeRequest = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnValidateTokenRequest = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnGrantAuthorizationCode = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnGrantRefreshToken = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnAuthorizeEndpoint = context =>
{
logger.WriteInformation(context.GetType().ToString());
return Task.FromResult<object>(null);
};
OnTokenEndpoint = context =>
{
logger.WriteInformation(context.GetType().ToString());
return Task.FromResult<object>(null);
};
OnGrantCustomExtension = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnValidateClientAuthentication = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
OnValidateClientRedirectUri = context =>
{
logger.WriteInformation(context.GetType().ToString());
context.Validated();
return Task.FromResult<object>(null);
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment