0
我嘗試找到導致基本登錄對話框訪問受保護的端點時提示的原因。 我們落後於SSL並使用Taffy REST框架。Taffy基本登錄提示出現
HTTP基本登錄我指的是這樣https://www.httpwatch.com/httpgallery/authentication/#showExample10 (點擊 「顯示圖片」 按鈕)
我們onTaffyRequest代碼
function onTaffyRequest(verb, cfc, requestArguments, mimeExt, headers, methodMetadata, matchedURI){
//get username and password
structAuth = structnew();
structAuth = getBasicAuthCredentials();
structAuth.authenticated = false;
local.status = "forbidden";
/*<!--- Get request from ColdFusion page contenxt. --->*/
objRequest = GetPageContext().GetRequest();
/*<!--- Get requested URL from request object. --->*/
requestArguments.strUrl = objRequest.GetRequestUrl().Append(
"?" & objRequest.GetQueryString()
).ToString();
/* CATCH NO BASIC auth*/
//if username is blank return false
if (structAuth.username is ""){
return representationOf(local.status).withStatus(401);
}
//check invalid password
if(structAuth.password is ""){
return representationOf(local.status).withStatus(401);
}
return true;
}
是對objRequest = GetPageContext()。的GetRequest ();使登錄提示出現?
我曾嘗試刪除objRequest = GetPageContext()。GetRequest(),並且沒有出現提示。我很困惑GetPageContext()。GetRequest()能夠帶來基本登錄提示 – Vlad