Esempio n. 1
0
        protected override Task <bool> ValidateInternal(SamlRequestValidationContext context)
        {
            var inboundContext = context.RequestContext;
            var validated      = false;

            if (inboundContext.SamlInboundMessage.Binding == new Uri(Kernel.Federation.Constants.ProtocolBindings.HttpRedirect))
            {
                validated = Helper.ValidateRedirectSignature(inboundContext, this._certificateManager);
            }
            else
            {
                validated = Helper.ValidateMessageSignature(inboundContext, this._signatureManager);
            }

            if (!validated)
            {
                throw new InvalidOperationException("Invalid signature.");
            }
            context.RequestContext.Validated();
            return(Task.FromResult(validated));
        }
 protected abstract Task <bool> ValidateInternal(SamlRequestValidationContext context);