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

Expose UserIdentity in AssertionResult #291

Closed

Conversation

iaik-jheher
Copy link
Contributor

This is part of the UserIdentity work I proposed in #289 (comment); I am breaking it down into smaller parts for ease of review.

This PR simply builds a UserIdentity in step 6 of FinishAssertionSteps (from the existing information) and passes it through to the final AssertionResult. For now, this does not enable additional functionality; however, it is necessary groundwork for being able to specify UserIdentity in StartAssertionOptions in the future.

I've also taken the liberty of restructuring step 6 a bit to make it easier to follow.

Copy link
Member

@emlun emlun left a comment

Choose a reason for hiding this comment

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

Thanks, but I don't think this is a good approach. The library has no reason to need the UserIdentity type in authentication ceremonies, so it shouldn't appear in the relevant interfaces. At best, passing UserIdentity through in AssertionResult would provide the RP with additional information that the RP already knows by inference. PR #293
(now closed) would have changed that, but I don't think that's the right way to go either.

username.flatMap(
un ->
assertedUserHandle.map(
uh -> UserIdentity.builder().name(un).displayName(un).id(uh).build()));
Copy link
Member

Choose a reason for hiding this comment

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

.name(un).displayName(un)

This is incorrect, and cannot be resolved without adding additional methods to CredentialRepository just for the sake of this feature. For this reason I don't think the UserIdentity type should be involved at all in authentication ceremonies - the library has no reason to need it, so it should not be required by the supported interfaces.

@emlun emlun closed this Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants