Skip to content

XSUAA Token getter in SecurityContext#1889

Merged
NiklasHerrmann21 merged 19 commits intomainfrom
get-xsuaa-token
Jan 16, 2026
Merged

XSUAA Token getter in SecurityContext#1889
NiklasHerrmann21 merged 19 commits intomainfrom
get-xsuaa-token

Conversation

@NiklasHerrmann21
Copy link
Copy Markdown
Contributor

  • changed the way the xsuaa token is retrieved by having an extension similar to the ID token retrieval to be able to perform an "getXsuaaToken" request out of the SecurityContext
  • changed the way SecurityContext is build by having a wrapper of the context data that is a single threadLocal to minimize ThreadLocal Storage

- changed the way the xsuaa token is retrieved by having an extension similar to the ID token retrieval to be able to perform an "getXsuaaToken" request out of the SecurityContext
- changed the way SecurityContext is build by having a wrapper of the context data that is a single threadLocal to minimize ThreadLocal Storage
- fixed test
- added javadoc and made some minor code changes
Comment thread java-api/src/main/java/com/sap/cloud/security/token/SecurityContext.java Outdated
Comment thread java-api/src/main/java/com/sap/cloud/security/token/SecurityContext.java Outdated
Comment thread java-api/src/main/java/com/sap/cloud/security/token/SecurityContext.java Outdated
Comment thread java-api/src/main/java/com/sap/cloud/security/token/SecurityContext.java Outdated
Comment thread java-api/src/main/java/com/sap/cloud/security/token/SecurityContext.java Outdated
- reworked securityContext as suggested in PR comments
- tests
- javadoc
- made clear methods private to achieve easier backward compatibility as they are not needed to be public
- changed the token exchange in spring from a flag to a string mode to be able to support both modes - exchanging the token and only loading the token into the storage
- made the get() method in SecurityContext private to solely rely on static methods
- changed the TokenExchangeMode to an Enum value
- adjusted tests
- adjusted Javadoc
- rework extension registration logic in HybridTokenAuthenticator
NiklasHerrmann21 and others added 5 commits December 19, 2025 09:10
- extended readme for new feature
… information into log files

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: NiklasHerrmann21 <49141792+NiklasHerrmann21@users.noreply.github.com>
…uper class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: NiklasHerrmann21 <49141792+NiklasHerrmann21@users.noreply.github.com>
- fixed javadoc for build
- fixed Integration test
@SAP SAP deleted a comment from sap-email-compliance Bot Dec 19, 2025
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
- MR comments, reworked README.md
@sap-email-compliance
Copy link
Copy Markdown

SAP employees are expected to use their SAP-email address for commits related to their work. Our compliance check has detected usage of an email other than a SAP one by a SAP employee. Please update your pull request accordingly.

If you think this is wrong or need any assistance, please contact ospo@sap.com.

- MR comments, reworked READMEs
- added a new setter for the XSUAA token
- added logic to both the authenticator and JWT Decoder to set the XSUAA token to the SecurityContext if the incoming token is already an XSUAA token
- MR comments, reworked READMEs
Copy link
Copy Markdown
Collaborator

@kuntzed kuntzed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just doc

Comment thread README.md
Comment thread java-security/README.md Outdated
Comment thread java-security/README.md Outdated
Comment thread java-security/README.md Outdated
Comment thread java-security/README.md Outdated
Comment thread spring-security/README.md Outdated
- MR comments, reworked READMEs and Javadoc
@NiklasHerrmann21 NiklasHerrmann21 dismissed finkmanAtSap’s stale review January 16, 2026 13:37

Cant find missing requested change - resolved all comments

@NiklasHerrmann21 NiklasHerrmann21 merged commit 0cfb490 into main Jan 16, 2026
6 checks passed
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.

4 participants