Skip to content

Missing log of "caused by" exception when OP document metadata cannot be reached  #9901

@amergey

Description

@amergey

Describe the bug
We cannot reach our OP server with Spring Security. We know Spring Security is not the cause of the issue, but the real cause is hidden to us because only partial stacktrace is logged:

Authorization Request failed: java.lang.IllegalStateException: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://opserver.com/.well-known/openid-configuration": Connection reset; nested exception is javax.net.ssl.SSLException: Connection reset

Looking at the code I saw this

in

org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter.unsuccessfulRedirectForAuthorization(HttpServletRequest, HttpServletResponse, Exception)

There is probably a typo

this.logger.error(LogMessage.format("Authorization Request failed: %s", ex, ex));

should be replaced with (the parenthesis is not at the right location)

this.logger.error(LogMessage.format("Authorization Request failed: %s", ex), ex);

It would allow to see the full stacktrace

Metadata

Metadata

Assignees

Labels

in: oauth2An issue in OAuth2 modules (oauth2-core, oauth2-client, oauth2-resource-server, oauth2-jose)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions