Пример #1
0
        //
        // Summary:
        //     Called to validate that the context.ClientId is a registered "client_id", and
        //     that the context.RedirectUri a "redirect_uri" registered for that client. This
        //     only occurs when processing the Authorize endpoint. The application MUST implement
        //     this call, and it MUST validate both of those factors before calling context.Validated.
        //     If the context.Validated method is called with a given redirectUri parameter,
        //     then IsValidated will only become true if the incoming redirect URI matches the
        //     given redirect URI. If context.Validated is not called the request will not proceed
        //     further.
        //
        // Parameters:
        //   context:
        //     The context of the event carries information in and results out.
        //
        // Returns:
        //     Task to enable asynchronous execution
        public override Task ValidateClientRedirectUri(Microsoft.Owin.Security.OAuth.OAuthValidateClientRedirectUriContext context)
        {
            if (context.ClientId.Equals(_publicClientId))
            {
                Uri expectedRootUri = new Uri(context.Request.Uri, "/");

                if (expectedRootUri.AbsoluteUri.Equals(context.RedirectUri))
                {
                    context.Validated();
                }
            }

            return(Task.FromResult <object>(null));
        }
Пример #2
0
 private Task ValidateClientRedirectUri(Microsoft.Owin.Security.OAuth.OAuthValidateClientRedirectUriContext context) {
     return Task.FromResult(0);
 }