Exemple #1
0
        public AuthorizeModule(
            IAuthorizationEndpointService service,
            IErrorResponseBuilder errorResponseBuilder)
            : base(OAuth.Configuration.GetFullPath(x => x.AuthorizationRequestRoute))
        {
            _service = service;
            _errorResponseBuilder = errorResponseBuilder;

            this.RequiresAuthentication();

            Get["/", ctx => OAuth.IsEnabled] = _ => Index();
            Post[OAuth.Configuration.AuthorizationAllowRoute, ctx => OAuth.IsEnabled] = _ => Allow();
            Post[OAuth.Configuration.AuthorizationDenyRoute, ctx => OAuth.IsEnabled]  = _ => Deny();
        }
Exemple #2
0
 public void SetUp()
 {
     _service = new DefaultAuthorizationEndpointService();
 }