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

API Guide: update auth section on bearer tokens #11099

Merged
merged 2 commits into from
Jan 28, 2025
Merged

Conversation

qqmyers
Copy link
Member

@qqmyers qqmyers commented Dec 16, 2024

This was a suggested edit for #10972 that I'm guessing wasn't seen before QA/merge.

Preview at https://dataverse-guide--11099.org.readthedocs.build/en/11099/api/auth.html#bearer-tokens

suggested edits
Base automatically changed from 10959-bearer-token-auth-ext to develop December 19, 2024 17:18
@qqmyers qqmyers added the Size: 0.5 A percentage of a sprint. 0.35 hours label Jan 15, 2025
@pdurbin pdurbin changed the title Update auth.rst API Guide: update auth section on bearer tokens Jan 22, 2025
@pdurbin pdurbin self-assigned this Jan 24, 2025
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

I'm adding my two cents but stopping short of approving this because I think @GPortas or someone closer to this work should affirm it's accurate.

doc/sphinx-guides/source/api/auth.rst Outdated Show resolved Hide resolved
doc/sphinx-guides/source/api/auth.rst Outdated Show resolved Hide resolved
doc/sphinx-guides/source/api/auth.rst Outdated Show resolved Hide resolved
@pdurbin pdurbin requested a review from GPortas January 24, 2025 19:48
If properties are provided in the JSON, but corresponding claims already exist in the identity provider, an error will be thrown, outlining the conflicting properties.
The one parameter required by default is ``termsAccepted`` which must be set to true, indicating that the user has seen and accepted the Terms of Use of the installation.

If the feature flag ``api-bearer-auth-handle-tos-acceptance-in-idp`` is enabled (along with the ``api-bearer-auth`` feature flag), Dataverse assumes that the Terms of Service acceptance was handled by the identity provider, e.g. in the OIDC ``consent`` dialog, and the ``termsAccepted`` parameter is not needed.
Copy link
Contributor

Choose a reason for hiding this comment

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

@pdurbin: Could we do this?
"If the feature flag api-bearer-auth-handle-tos-acceptance-in-idp is enabled (along with the api-bearer-auth feature flag), Dataverse assumes that the Terms of Service acceptance is handled by the Identity Provider and therefore the ``termsAccepted'' parameter is not needed."

The current process is not true authentication. The system receives a token that may not be intended for it, and uses it to create an account without prompting. The real authentication takes place somewhere else, we assume the SPA, where hopefully the consent screen is used. With this formulation, the behaviour is less ambiguous, since Dataverse itself has no means of using a consent screen.

Copy link
Member

Choose a reason for hiding this comment

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

@qqmyers what do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a documentation PR trying to clarify what has already been implemented/merged in #10972.

If there's something to change other than tweaking language, it should probably be a new issue (which should probably be in the dataverse-security repo). FWIW: I could be wrong, but I don't believe that "The system receives a token that may not be intended for it, and uses it to create an account without prompting" is true - the received token is used to call the userinfo API of registered providers only, and only if one of them returns a valid userinfo response is an account created.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW: I could be wrong, but I don't believe that "The system receives a token that may not be intended for it, and uses it to create an account without prompting" is true - the received token is used to call the userinfo API of registered providers only, and only if one of them returns a valid userinfo response is an account created.

This scenario only applies if a third party has a valid token (which stays valid during the user info API calls) and send it without user consent to a dataverse instance. This is to be honest a malicious scenario, which most likely will not occur.

@qqmyers qqmyers removed their assignment Jan 27, 2025
@pdurbin
Copy link
Member

pdurbin commented Jan 27, 2025

I'm adding my two cents but stopping short of approving this because I think @GPortas or someone closer to this work should affirm it's accurate.

At standup @GPortas said he'd take a look. Thanks!

@pdurbin pdurbin assigned GPortas and unassigned pdurbin Jan 27, 2025
Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

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

Looks good to me. The new language tweaks make the behavior much clearer.

@ofahimIQSS ofahimIQSS self-assigned this Jan 27, 2025
@ofahimIQSS
Copy link
Contributor

proof read, no issues found. merging pr

@ofahimIQSS ofahimIQSS merged commit 16422d5 into develop Jan 28, 2025
3 checks passed
@ofahimIQSS ofahimIQSS deleted the qqmyers-patch-2 branch January 28, 2025 16:57
@ofahimIQSS ofahimIQSS removed their assignment Jan 28, 2025
@pdurbin pdurbin added this to the 6.6 milestone Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 0.5 A percentage of a sprint. 0.35 hours
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

5 participants