问题标签 [www-authenticate]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
353 浏览

perl - 使用 WWW::Scripter 字符集问题登录 Java 站点

我正在尝试使用 WWW::Scripter 模块登录到 Java 网站。使用 WWW::Mechanize 模块可以正常工作,但是一旦通过身份验证,该站点就有我需要调用的 JavaScript 函数 - 因此需要 Scripter。

经过大量的故障排除后,我发现从 click() 事件发送的数据包的差异是 Content-Type varaibale。
Mechanize 有: Content-Type: application/x-www-form-urlencoded\r\n 但 Scripter 有: Content-Type: application/x-www-form-urlencoded; charset="ISO-8859-1"\r\n(这是使用WireShark查看的)

这解释了我从网站收到的错误:

错误消息:“ISO-8859-1”错误堆栈跟踪:java.nio.charset.IllegalCharsetNameException:“ISO-8859-1”在 java.nio.charset.Charset.checkName(Charset.java:305) 在 java.nio .charset.Charset.lookup(Charset.java:439) at java.nio.charset.Charset.forName(Charset.java(Inlined Compiled Code))

堆代码))在 java.lang.StringCoding$1.run(StringCoding.java(编译代码))在 java.security.AccessController.doPrivileged1(本机方法)在 java.security.AccessController.doPrivileged(AccessController.java(编译代码) )) 在 java.lang.StringCoding$DecoderCache.getDecoder(StringCoding.java(Comp iled Code)) 在 java.lang.StringCoding.getDecoder(StringCoding.java(Inlined Compiled Code)) 在 java.lang.StringCoding.decode(StringCoding .java(Compiled Code)) at java.lang.String.(String.java(Compiled Code)) at java.lang.String.(String.java(Inlined Compiled Code)) at com.ibm.ws.webcontainer.servlet .RequestUtils.parsePostData(RequestUti ls.java(Compiled Code)) 在 com.ibm.ws.webcontainer.srt.SRTServletRequest.parseParameters(SRTServ letRequest.java(Compiled Code)) at com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameterNames(SRTSe rvletRequest.java(Compiled Code)) at javax.servlet.ServletRequestWrapper.getParameterNames(ServletRequestW rapper.java(Compiled Code)) at org .apache.struts.util.RequestUtils.populate(RequestUtils.java(Compiled Code)) at org.apache.struts.action.RequestProcessor.processPopulate(RequestProc essor.java(Compiled Code)) at org.apache.struts.action .RequestProcessor.process(RequestProcessor.java(Compiled Code)) at org.apache.struts.action.ActionServlet.process(ActionServlet.java(Inl ined Compiled Code)) at org.apache.struts.action.ActionServlet.doPost( ActionServlet.java(编译代码))在 javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(Stric tServletInstance.java(Compiled Code)) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(Stric tLifecycleServlet.java(Compiled Code)) 在 com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecy cleServlet.java(Compiled Code)) 在 com. ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(Strict LifecycleServlet.java(Inlined Compiled Code)) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code)) at com.ibm .ws.webcontainer.servlet.ValidServletReferenceState.dispatch(V alidServletReferenceState.java(编译代码))在com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(Ser vletInstanceReference.java(内联编译代码))在com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilte rChain.java (编译代码))在 com.infostream.web.filters.HibernateSessionFilter.doFilter(HibernateS essionFilter.java(编译代码))在 com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterI nstanceWrapper.java(编译代码) ) 在 com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilte rChain.java(Compiled Code)) 在 com.infostream.web.filters.IdentificationFilter.doFilter(IdentificationFilter.java(Compiled Code)) 在 com。 ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java(编译代码))在com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilte rChain.java(编译代码))在com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDi spatch(WebAppRequestDispatcher.java(编译代码)) 在 com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebApp pRequestDispatcher.java(编译代码)) 在 com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebApp RequestDispatcher.java(编译代码) )) 在 com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java (编译代码)) 在 com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebApp Invoker.java(编译代码))在 com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(编译代码))在 com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(编译代码))在 com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(服务器 vletRequestProcessor。 java(编译代码))在com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSE Listener.java(编译代码))在com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnect ion.java( Compiled Code)) at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.ja va(Compiled Code)) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code)) at com. ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(编译代码))com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(Ser vletRequestProcessor.java(Compiled Code)) 上 com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher 上的 CacheableInvocationContext.i nvoke(CacheableInvocationContext.java(Compiled Code))。 com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnect ion.java(编译代码)) com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection. JAVA(编译代码))在 com.ibm.ws.http.HttpConnection.run(HttpConnection.java(编译代码))在 com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(编译代码) )com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(Ser vletRequestProcessor.java(Compiled Code)) 上 com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher 上的 CacheableInvocationContext.i nvoke(CacheableInvocationContext.java(Compiled Code))。 com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnect ion.java(编译代码)) com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection. JAVA(编译代码))在 com.ibm.ws.http.HttpConnection.run(HttpConnection.java(编译代码))在 com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(编译代码) )dispatchByURI(Ser vletRequestProcessor.java(Compiled Code)) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSE Listener.java(Compiled Code)) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest( HttpConnection.java(编译代码))在 com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.ja va(编译代码))在 com.ibm.ws.http.HttpConnection.run(HttpConnection.java(编译代码) ) ) 在 com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))dispatchByURI(Ser vletRequestProcessor.java(Compiled Code)) at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSE Listener.java(Compiled Code)) at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest( HttpConnection.java(编译代码))在 com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.ja va(编译代码))在 com.ibm.ws.http.HttpConnection.run(HttpConnection.java(编译代码) ) ) 在 com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))http.HttpConnection.readAndHandleRequest(HttpConnection.ja va(Compiled Code)) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code) ) at com.ibm.ws.util.ThreadPool$Worker.run (ThreadPool.java(编译代码))http.HttpConnection.readAndHandleRequest(HttpConnection.ja va(Compiled Code)) at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code) ) at com.ibm.ws.util.ThreadPool$Worker.run (ThreadPool.java(编译代码))

我用来测试登录的代码是:

如前所述,如果我使用 WWW::Mechanize 而不是 WWW::Scripter,这可以正常工作。

谁能建议我可以做些什么来删除正在发布的数据包的 Content-Type 中的字符集字段。

0 投票
2 回答
1969 浏览

php - 如何更改 WWW-Authenticate 弹出框的设计/样式以匹配我的网站主题?

晕那里,

我需要更改 WWW-Authenticate 弹出框的外观/设计以匹配我的网站主题,当用户需要登录到安全页面时,我不希望它显示默认的身份验证弹出框。下面是我用来创建 WWW-Authenticate 弹出窗口的 PHP 脚本。

以下是我在需要保护或保护的所有页面中使用的代码。

请帮助...记住代码工作正常我只想改变外观。感谢先进:)

0 投票
1 回答
1737 浏览

php - 在 Kohana 中抛出一个自定义的 401 HTTP 异常

当我抛出一个HTTP_Exception_401时,Kohana 3.3我得到以下错误:

现在这里明显的问题是www-authenticate标题尚未设置。

我正在努力弄清楚如何以及在哪里设置它。
我尝试了以下方法,但抛出了相同的错误:

使用原生 PHP header()

向请求对象添加标头:

我试图从控制器抛出异常。
任何帮助,将不胜感激。

0 投票
1 回答
629 浏览

apache - Apache - 允许目录列表但下载文件需要 vaild-user

我想让我的朋友在不记录的情况下查看目录中的所有文件。但是当他们想下载文件时,我想对他们进行身份验证。这个怎么做 ?

现在我有这样的事情:

0 投票
1 回答
72 浏览

perl - 建立会话以使用 Perl 调用 URL

我正在尝试使用 WWW::Mechanize perl 模块从网页中挖掘数据。但是,我首先需要建立一个连接,以便该网页允许我访问数据。在浏览器中,我可以通过单击特定的 href 链接来建立此连接。有没有办法用 Perl 做到这一点?

非常感谢。

0 投票
1 回答
768 浏览

oracle-adf - Apply ADF Security with WWW-Authenticate NTLM

I am developing an application in Oracle ADF that needs to apply a user login authentication.

The security protocol followed by the company is to read the username from the Windows Credentials and checking if that username exists in a certain database table. The applications that use this policy are usually JSP or .NET applications and do this by setting response.setHeader("WWW-Authenticate", "NTLM") which pops the authentication dialog then reads the username entered and calls an SQL query to check if that username exists in the database and checks the role.

I need to implement that in ADF and I cannot find a way to do so. All the information that I've found is regarding configuring realms in the WebLogic and using an SQLAuthenticate on the Weblogic server.

I tried putting the code in a managed bean using beforePhase on the view and it didn't work.

What can I do?

0 投票
0 回答
119 浏览

javascript - 验证标头

我的 Web 应用程序直到最近才成功运行 Windows 身份验证。我没有对 IIS 配置或代码修改或用户权限更改进行任何更改。

我可以登录到应用程序,但是当 javascript 确实重定向时,它会返回到同一页面。我检查了提琴手头。一旦我最初登录,标题就有 WWW-Authenticate 参数。当通过 JavaScript 代码完成重定向时,无论是 AJAX 还是设置windows.lovation.href='MyPage'它都不会传递 WWW-Authenticate 标头值。

因此,一旦我直接进入此应用程序下的任何页面,它就会正常加载并且我看到 WWW-Authenticate 参数,但是使用 JavaScript 时,WWW-Authenticate 参数丢失了。再次没有对服务器进行任何更改。

我认为它可能与 Windows 自动更新有关。但这只是疯狂的猜测。

0 投票
1 回答
2140 浏览

apache - Apache动态白名单

我正在寻找动态白名单的解决方案,所以我不需要重新启动 apache2 服务。我试图做这样的事情:

但是这个解决方案对我不起作用。我也试过这个,但我不确定我的 whitelist.txt 是否正确。它应该是什么样子?

或者也许还有另一种更好的方法来为 Apache2 制作动态白名单?

0 投票
1 回答
495 浏览

android - HttpPost获取身份验证错误

我越来越Authentication error: Unable to respond to any of these challenges: {}

这是来自服务器的响应

这是我的代码

这是我想在 cURL 中实现的

我使用了网络嗅探器

这是必需的标题

WWW-Authenticate: Digest realm="REST API" qop="auth" nonce="52f19001dc626" opaque="aba3d4b49c454e1974970e7b5514b001"

内容长度: 41
变化:接受编码,用户代理
连接:关闭
内容类型: json

有什么建议吗?

0 投票
1 回答
10208 浏览

python - urllib2.HTTPError:HTTP 错误 401:未经授权

我的要求是从某个网站http://clientdownload.xyz.com/Documents/abc.zip下载 abc.zip 文件

对于这个活动,我编写了一个 python 脚本,如下所示:

而我在运行脚本时收到以下错误:

文件“updateCheck.py”,第 68 行,在 check_update zip_file = urllib2.urlopen(url_to_check).read() 文件“/usr/lib/python2.7/urllib2.py”,第 126 行,在 urlopen 返回 _opener.open( url,数据,超时)文件“/usr/lib/python2.7/urllib2.py”,第 406 行,打开响应 = meth(req,响应)文件“/usr/lib/python2.7/urllib2.py” , 第 519 行, 在 http_response 'http', 请求, 响应, 代码, msg, hdrs) 文件 "/usr/lib/python2.7/urllib2.py", 第 444 行, 错误返回 self._call_chain(*args) 文件“/usr/lib/python2.7/urllib2.py”,第 378 行,在 _call_chain 结果 = func(*args) 文件“/usr/lib/python2.7/urllib2.py”,第 527 行,在 http_error_default 中引发 HTTPError (req.get_full_url(), 代码, msg, hdrs, fp) urllib2.HTTPError: HTTP 错误 401:未经授权

我已经正确输入了用户名和密码,但它会引发未经授权的错误。

当我尝试使用带有-http-user and --ask-password选项的 wget 链接下载它时,我能够下载该文件。

也使用相同的脚本,我能够正确地从其他服务器下载文件。

我运行此脚本以获取更多信息:

我得到以下信息:

NTLM