【发布时间】:2019-09-18 10:48:26
【问题描述】:
我正在尝试通过公司内部身份验证服务器进行身份验证和身份验证。
使用 ERR_TOO_MANY_REDIRECTS 和 HTTP 302 得到以下错误
2019-09-18 09:23:54.310 TRACE 8 --- [qtp254692047-20] s.n.www.protocol.http.HttpURLConnection : KeepAlive stream retrieved from the cache, sun.net.www.protocol.https.HttpsClient(https://privateURL/tokeninfo)
2019-09-18 09:23:54.310 TRACE 8 --- [qtp254692047-20] s.n.www.protocol.http.HttpURLConnection : Proxy used: DIRECT
2019-09-18 09:23:54.310 DEBUG 8 --- [qtp254692047-20] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@3b6fad4e6 pairs: {GET /oauth2/tokeninfo HTTP/1.1: null}{Authorization: Bearer eyJraWQiOi####}{Accept: application/json, application/*+json}{User-Agent: Java/11.0.4}{Host: privateURL.com}{Connection: keep-alive}
2019-09-18 09:23:54.315 DEBUG 8 --- [qtp254692047-20] s.n.www.protocol.http.HttpURLConnection : sun.net.www.MessageHeader@56d0f8f314 pairs: {null: HTTP/1.1 401 Unauthorized}{Date: Wed, 18 Sep 2019 09:23:54 GMT}{Content-Type: application/problem+json}{Transfer-Encoding: chunked}{Connection: keep-alive}{Cache-Control: no-cache, no-store, max-age=0, must-revalidate}{Expires: 0}{Pragma: no-cache}{Server: unspecified}{Strict-Transport-Security: max-age=31536000 ; includeSubDomains}{X-Content-Type-Options: nosniff}{X-Flow-Id: RiNj7zF0fq3MWJBePUzlkA}{X-Frame-Options: DENY}{X-Xss-Protection: 1; mode=block}
2019-09-18 09:23:54.316 DEBUG 8 --- [qtp254692047-20] s.n.www.protocol.http.HttpURLConnection : Server Authentication for AuthenticationHeader: prefer null returned null
2019-09-18 09:23:54.316 DEBUG 8 --- [qtp254692047-20] org.springframework.web.HttpLogging : Response 401 UNAUTHORIZED
2019-09-18 09:23:54.317 DEBUG 8 --- [qtp254692047-20] o.s.w.c.HttpMessageConverterExtractor : Reading to [org.springframework.security.oauth2.common.exceptions.OAuth2Exception]
2019-09-18 09:23:54.318 WARN 8 --- [qtp254692047-20] o.s.b.a.s.o.r.UserInfoTokenServices : Could not fetch user details: class org.springframework.web.client.HttpClientErrorException$Unauthorized, 401 Unauthorized
2019-09-18 09:23:54.318 DEBUG 8 --- [qtp254692047-20] o.s.b.a.s.o.r.UserInfoTokenServices : userinfo returned error: Could not fetch user details
...
2019-09-18 09:23:54.229 DEBUG 8 --- [qtp254692047-18] o.s.b.a.audit.listener.AuditListener : AuditEvent [timestamp=2019-09-18T09:23:54.229553Z, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@0: RemoteIpAddress: 99.99.99.99; SessionId: xxx, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]
...
ttp_server_requests_seconds{exception="None",method="GET",outcome="REDIRECTION",status="302",uri="REDIRECTION",quantile="0.5",} 0.011534336
http_server_requests_seconds{exception="None",method="GET",outcome="REDIRECTION",status="302",uri="REDIRECTION",quantile="0.75",} 0.014680064
http_server_requests_seconds{exception="None",method="GET",outcome="REDIRECTION",status="302",uri="REDIRECTION",quantile="0.95",} 0.047710208
http_server_requests_seconds{exception="None",method="GET",outcome="REDIRECTION",status="302",uri="REDIRECTION",quantile="0.99",} 0.536346624
http_server_requests_seconds_count{exception="None",method="GET",outcome="REDIRECTION",status="302",uri="REDIRECTION",} 14.0
http_server_requests_seconds_sum{exception="None",method="GET",outcome="REDIRECTION",status="302",uri="REDIRECTION",} 0.719216709```
Any pointers on what could be the problem here ?
【问题讨论】:
-
我认为是自我解释
ERR_TOO_MANY_REDIRECTS -
ERR_TOO_MANY_REDIRECTS 是症状,可能是什么原因?
-
它写在我的回答中。