在过去的几周内,我们使用 Google 的 Oauth2 身份验证系统和 Apache Oltu 库的一套应用程序已经停止工作。
所有通过 Google 注册或登录的尝试都会遇到相同的错误:
Login/registration action failed: java.io.IOException: Attempted read from closed stream.
最近一切正常,在此期间我们没有对代码或应用程序进行任何更改。
Google 端是否发生了一些变化,导致所有这些请求都失败了?
我的 Google 开发者控制台似乎没有任何日志记录或信息。在我的应用程序中,日志条目表明尝试进行身份验证但未成功。
现在失败的代码,曾经成功的代码是:
// obtain a AuthRequest message to be sent to the OpenID provider
OAuthClientRequest oauthRequest = OAuthClientRequest
.authorizationLocation(discovery.getAuthzEndpoint())
.setClientId(Oauth2Util.getClientId())
.setRedirectURI(responseURL)
.setResponseType(ResponseType.CODE.toString())
.setScope(GOOGLE_SCOPE)
.setState(state)
.buildQueryMessage();
response.sendRedirect(oauthRequest.getLocationUri());
触发异常:
java.io.IOException: Attempted read from closed stream.
感激地收到所有建议