-
-
Save anonymous/8a0079b705423b406c00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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