public ValueTask <IdentityHttpResponse> Logout(string state) { var id = SamlIDManager.Generate(serviceProvider); var requestDocument = new Saml2LogoutRequest( id: id, issuer: serviceProvider, destination: redirectUrlPostLogout ); var requestBinding = Saml2Binding.GetBindingForDocument(requestDocument, BindingType.Query, XmlSignatureAlgorithmType.RsaSha256, null, null); requestBinding.Sign(serviceProviderCert, requiredSignature); requestBinding.GetResponse(logoutUrl); var response = requestBinding.GetResponse(logoutUrl); return(new ValueTask <IdentityHttpResponse>(response)); }
public ValueTask <IdentityHttpResponse> Login(string state) { var id = SamlIDManager.Generate(serviceProvider); var requestDocument = new Saml2AuthnRequest( id: id, issuer: serviceProvider, assertionConsumerServiceURL: redirectUrl, bindingType: BindingType.Form ); var requestBinding = Saml2Binding.GetBindingForDocument(requestDocument, BindingType.Form, XmlSignatureAlgorithmType.RsaSha256, null, null); requestBinding.Sign(serviceProviderCert, requiredSignature); var response = requestBinding.GetResponse(loginUrl); return(new ValueTask <IdentityHttpResponse>(response)); }