OAuth.AspNet.AuthServer.OAuthMatchContext.MatchesAuthorizeEndpoint C# (CSharp) Method

MatchesAuthorizeEndpoint() public method

Sets the endpoint type to authorize endpoint.
public MatchesAuthorizeEndpoint ( ) : void
return void
        public void MatchesAuthorizeEndpoint()
        {
            IsAuthorizeEndpoint = true;
            IsTokenEndpoint = false;
        }

Usage Example

        public override async Task <bool> HandleRequestAsync()
        {
            var matchRequestContext = new OAuthMatchContext(Context, Options);

            if (Options.AuthorizeEndpointPath.HasValue && Options.AuthorizeEndpointPath == Request.Path)
            {
                matchRequestContext.MatchesAuthorizeEndpoint();
            }
            else if (Options.TokenEndpointPath.HasValue && Options.TokenEndpointPath == Request.Path)
            {
                matchRequestContext.MatchesTokenEndpoint();
            }

            await Options.Provider.MatchEndpoint(matchRequestContext);

            if (matchRequestContext.HandledResponse)
            {
                return(true);
            }

            if (matchRequestContext.Skipped)
            {
                return(false);
            }

            if (matchRequestContext.IsAuthorizeEndpoint || matchRequestContext.IsTokenEndpoint)
            {
                if (!Options.AllowInsecureHttp && !Context.Request.IsHttps)
                {
                    Logger.LogWarning("Authorization server ignoring http request because AllowInsecureHttp is false.");

                    return(false);
                }

                if (matchRequestContext.IsAuthorizeEndpoint)
                {
                    return(await InvokeAuthorizeEndpointAsync());
                }

                if (matchRequestContext.IsTokenEndpoint)
                {
                    await InvokeTokenEndpointAsync();

                    return(true);
                }
            }

            return(false);
        }