Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Configuration(IAppBuilder app)
- {
- OAuthOptions = new OAuthAuthorizationServerOptions()
- {
- TokenEndpointPath = new PathString("/token"),
- Provider = new OAuthAuthorizationServerProvider()
- {
- OnValidateClientAuthentication = async (context) =>
- {
- context.Validated();
- },
- OnGrantResourceOwnerCredentials = async (context) =>
- {
- if (context.UserName == "test.test@mail.com" && context.Password == "test123")
- {
- ClaimsIdentity oAuthIdentity = new ClaimsIdentity(context.Options.AuthenticationType);
- context.Validated(oAuthIdentity);
- }
- }
- },
- AllowInsecureHttp = true,
- AccessTokenExpireTimeSpan = TimeSpan.FromDays(1)
- };
- app.UseOAuthBearerTokens(OAuthOptions);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement