Exemplo n.º 1
0
 public override Task MatchEndpoint(MatchEndpointContext context)
 {
     if (context.Options.AuthorizationEndpointPath.HasValue &&
         context.Request.Path.Value.StartsWith(context.Options.AuthorizationEndpointPath))
     {
         context.MatchAuthorizationEndpoint();
     }
     return(Task.CompletedTask);
 }
        /// <summary>
        /// Validate whether the requested endpoint is the authentication endpoint.
        /// This supports all endopoints starting with AuthorizationEndpointPath (eg "/account/authorize"
        /// </summary>
        public override Task MatchEndpoint(MatchEndpointContext context)
        {
            if (context.Options.AuthorizationEndpointPath.HasValue &&
                context.Request.Path.StartsWithSegments(context.Options.AuthorizationEndpointPath))
            {
                context.MatchesAuthorizationEndpoint();
            }

            return(Task.FromResult(true));
        }
Exemplo n.º 3
0
        public override Task MatchEndpoint(MatchEndpointContext context)
        {
            // Note: by default, OpenIdConnectServerHandler only handles authorization requests made to the authorization endpoint.
            // This context handler uses a more relaxed policy that allows extracting authorization requests received at
            // /connect/authorize/accept and /connect/authorize/deny (see AuthorizationController.cs for more information).
            if (context.Options.AuthorizationEndpointPath.HasValue &&
                context.Request.Path.StartsWithSegments(context.Options.AuthorizationEndpointPath))
            {
                context.MatchesAuthorizationEndpoint();
            }

            return(Task.FromResult <object>(null));
        }
        public override Task MatchEndpoint(MatchEndpointContext context)
        {
            if (!context.Options.AuthorizationEndpointPath.HasValue)
                return Task.CompletedTask;

            var requestPath = context.Request.Path;
            var authorizePath = context.Options.AuthorizationEndpointPath;

            if (ValidAuthorizeEndpoints.Any((endpoint) => (requestPath == authorizePath.Add(endpoint))))
                context.MatchesAuthorizationEndpoint();

            return Task.CompletedTask;
        }
Exemplo n.º 5
0
 public override Task MatchEndpoint(MatchEndpointContext context)
 {
     // Note: by default, the OIDC server middleware only handles authorization requests made to
     // AuthorizationEndpointPath. This handler uses a more relaxed policy that allows extracting
     // authorization requests received at /connect/authorize/accept and /connect/authorize/deny.
     if (context.Options.AuthorizationEndpointPath.HasValue &&
         context.Request.Path.Value.StartsWith(context.Options.AuthorizationEndpointPath))
     {
         context.MatchAuthorizationEndpoint();
     }
     else if (context.Options.RevocationEndpointPath.HasValue &&
              context.Request.Path.Value.StartsWith(context.Options.RevocationEndpointPath))
     {
         context.MatchRevocationEndpoint();
     }
     return(Task.CompletedTask);
 }
Exemplo n.º 6
0
 public override Task MatchEndpoint([NotNull] MatchEndpointContext context)
 => _eventDispatcher.DispatchAsync(new OpenIddictServerEvents.MatchEndpoint(context));
 public Task MatchEndpoint(MatchEndpointContext context) => OnMatchEndpoint(context);