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

[CXF-8236] add support of signature challenges in the STSClient #651

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SergiusMohr
Copy link

No description provided.

Comment on lines +1494 to +1503
} else if ("SignChallenge".equals(ln)) {
el = DOMUtils.getFirstElement(el);
if ("Challenge".equals(el.getLocalName())) {
// maybe another implementation of the return object is more useful.
// We need to transport only two values:
// challengeValue and a marker for the kind of response (SignChallenge response)
SecurityToken token = new SecurityToken(DOMUtils.getContent(el));
token.setTokenType("SignChallenge");
return token;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could have a new Challenge class which is referenced in SecurityToken. Challenge could have an enum describing the type, maybe just SIGNATURE for now.

* @return SecurityToken
* @throws Exception
*/
public SecurityToken requestSecurityTokenResponse(String action, String challengeValue) throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd prefer to remove this method altogether. Instead, refactor "issue" so that it can work for both cases. The only difference should be "RequestSecurityTokenResponse" instead of "RequestSecurityToken" for the normal issue case. Maybe the writing out of the Challenge itself could be delegated to the Challenge class itself.

Then in SecurityToken.requestSecurityToken, I think we could handle the SignChallenge case automatically. If the SecurityToken that is returned from the STS contains a SignChallenge then invoke again on the STS with the challenge.

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.

3 participants