public string GetLogoutRequest(string logoutRequestId, string sessionIndex, string subject, string relayState)
        {
            var signingCertificate = _certificateProvider.GetCertificate();

            var logoutRequest = _saml2MessageFactory.CreateLogoutRequest(logoutRequestId, sessionIndex, subject);

            return(_httpRedirectBinding.BuildLogoutRequestUrl(logoutRequest,
                                                              signingCertificate.ServiceProvider.PrivateKey, _identityProviderConfiguration.HashingAlgorithm,
                                                              relayState));
        }
Ejemplo n.º 2
0
        public Task InitiateSloAsync(string providerName, string requestId, string relayState = null)
        {
            var sessionIndex  = Context.User.GetSessionIndex();
            var subject       = Context.User.GetSubject();
            var logoutRequest = _samlMessageFactory.CreateLogoutRequest(providerName, requestId, sessionIndex, subject);

            var url = _httpRedirectBinding.BuildLogoutRequestUrl(providerName, logoutRequest, relayState);

            Context.Response.Redirect(url);

            _logger.LogDebug($"Method={nameof(InitiateSloAsync)}. Redirecting to saml identity provider for SLO. Url={url}");
            return(Task.CompletedTask);
        }