public void ConfigureOAuth(IAppBuilder app, ICharacterAppService characterAppService) { OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions() { AllowInsecureHttp = true, TokenEndpointPath = new PathString("/api/security/token"), AccessTokenExpireTimeSpan = TimeSpan.FromDays(7), Provider = new SimpleAuthorizationServerProvider(characterAppService) }; // Token Generation app.UseOAuthAuthorizationServer(OAuthServerOptions); app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions()); }
public CharacterController(ICharacterAppService characterAppService) { _characterAppService = characterAppService; }
public SimpleAuthorizationServerProvider(ICharacterAppService characterAppService) { _characterAppService = characterAppService; }
private void ConfigurarAppSerice() { _characterAppService = Substitute.For <ICharacterAppService>(); OverrideRegistration <ICharacterAppService>((provider) => _characterAppService); }