Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DwC - Avoid superflous WARN log messages #1415

Merged
merged 4 commits into from
Jan 4, 2024
Merged

Conversation

nenaraab
Copy link
Contributor

@nenaraab nenaraab commented Jan 2, 2024

In case of DwC setup, there is no need to have an xsuaa service bound to the cloud foundry application. Token is validated in the jupiter component. Therefore, the WARN log should be written a single time time, and not every time the token gets created via HybridTokenFactory.

With that change the log messages looks as following (spring-security-hybrid-usage sample - TestControllerTest.sayHello()):

2024-01-02 16:03:14.873  WARN 19633 --- [           main] c.s.c.s.servlet.HybridTokenFactory       : There is no xsuaa service configuration with 'xsappname' property: no local scope check possible.
2024-01-02 16:03:36.415  INFO 19633 --- [           main] c.s.c.s.t.v.v.XsuaaJwtSignatureValidator : Loaded custom JKU factory
2024-01-02 16:03:56.008  INFO 19633 --- [           main] c.s.c.security.client.HttpClientFactory  : loaded HttpClientFactory service providers: [com.sap.cloud.security.client.DefaultHttpClientFactory@696298ea]
2024-01-02 16:03:56.176  INFO 19633 --- [           main] c.s.c.s.t.v.v.JwtAudienceValidator       : The audiences that are derived from the token: [sb-clientId!t0815].
2024-01-02 16:03:59.714  WARN 19633 --- [           main] com.sap.cloud.security.token.XsuaaToken  : origin claim not set in JWT. Cannot create unique user name. Returning null.
2024-01-02 16:03:59.715  INFO 19633 --- [           main] c.s.h.c.l.servlet.filter.RequestLogger   : {"request":"/sayHello","referer":"-","response_sent_at":"2024-01-02T15:03:59.715030Z","response_status":200,"method":"GET","response_size_b":276,"request_size_b":-1,"remote_port":"redacted","layer":"[SERVLET]","remote_host":"redacted","remote_user":"-","protocol":"HTTP/1.1","remote_ip":"redacted","response_content_type":"application/json","request_received_at":"2024-01-02T15:02:35.038165Z","response_time_ms":84676.865,"direction":"IN"}
2024-01-02 16:03:59.725  INFO 19633 --- [           main] Spring Security Debugger       

@nenaraab nenaraab changed the title Avoid warn messages in case there is no service configuration Support DwC - Avoid superflous WARN log messages #1414 Jan 2, 2024
@nenaraab nenaraab changed the title Support DwC - Avoid superflous WARN log messages #1414 Support DwC - Avoid superflous WARN log messages Jan 2, 2024
@nenaraab nenaraab requested a review from liga-oz January 3, 2024 12:03
@liga-oz liga-oz merged commit 1a4bac7 into main Jan 4, 2024
5 checks passed
@liga-oz liga-oz deleted the dwc-support-3.x branch January 4, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants