1
我正在爲SAML2授權編寫我自己的授權提供程序。爲了幫助我,我得到了一個第三方庫來處理大部分SAML2規範。ServiceStack Authorize方法的返回對象應該是什麼?
但是,該庫是爲ASP.NET HttpHandler
接口編寫的,其中ProcessRequest
方法沒有返回值。
有了這個庫,這個方法本身不會返回任何東西,但是會處理大部分壓縮認證請求XML的工作,創建XML的簽名並告訴瀏覽器重定向到SAML2登錄頁面,呼叫的屬性。所以它爲我做了很多工作。
一些僞代碼:
public object Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)
{
...
AuthnRequest authnRequestXML = saml2Util.CreateAuthnRequestXML();
HttpResponseBase httpResponse = authService.Request.Response.OriginalResponse as HttpResponseBase;
// This takes care of signing, compression of the authnRequestXML and the redirect action
SAML2Library.SendAuthnRequestByHTTPRedirect(httpResponse, DestinationURL, authnRequestXML, certificatePrivateKey);
return ?;
}
返回null
沒有工作。 在這種情況下,我應該如何設置Authenticate
方法的返回值?
沒有工作。重定向已經在SendAuthnRequestByHTTPRedirect方法中處理了。我失去了正確的SAML請求所需的參數。 – user3479957 2014-09-29 07:52:20
對我來說一個解決方法似乎爲我的重定向調用生成所有必需的參數,並使用HttpResult.Redirect方法。 – user3479957 2014-09-29 08:02:15