Skip to content

Responder: Add completeUri in EIdP JSON message#8422

Draft
eisenmann-b1 wants to merge 1 commit into
SSSD:masterfrom
eisenmann-b1:passwordless-gdm-complete-uri
Draft

Responder: Add completeUri in EIdP JSON message#8422
eisenmann-b1 wants to merge 1 commit into
SSSD:masterfrom
eisenmann-b1:passwordless-gdm-complete-uri

Conversation

@eisenmann-b1
Copy link
Copy Markdown
Contributor

This adds verification_uri_complete as JSON parameter completeUri in the message provided to GDM.

Ideally, this would be used for QR codes, if non-empty.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a completeUri field to the EIdP JSON message. The implementation is straightforward, but the associated tests appear to be broken as the test expectations were not updated. I've also included a suggestion to conditionally add the new field to the JSON payload to align better with the intent described in the pull request description.

Comment thread src/tests/cmocka/test_pamsrv_json.c
"role", "eidp",
"initPrompt", auth_data->oauth2->init_prompt,
"linkPrompt", auth_data->oauth2->link_prompt,
"completeUri", auth_data->oauth2->complete_uri,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The pull request description mentions that completeUri should ideally be used "if non-empty". To better align with this, consider omitting the completeUri field from the JSON object when its value is NULL or an empty string. This would simplify parsing on the consumer side, as it would only need to check for the key's existence.

This would require refactoring the json_pack() call to build the object by adding fields conditionally, for example:

json_oauth2 = json_pack("{s:s,s:s,s:s,s:s,s:s,s:i}",
                        "name", "Web Login",
                        "role", "eidp",
                        "initPrompt", auth_data->oauth2->init_prompt,
                        "linkPrompt", auth_data->oauth2->link_prompt,
                        "uri", auth_data->oauth2->uri,
                        "code", auth_data->oauth2->code,
                        "timeout", 300);
if (json_oauth2 == NULL) { ... }

if (auth_data->oauth2->complete_uri && *auth_data->oauth2->complete_uri) {
    json_object_set_new(json_oauth2, "completeUri",
                      json_string(auth_data->oauth2->complete_uri));
    // ... error handling ...
}

@alexey-tikhonov
Copy link
Copy Markdown
Member

Hi @eisenmann-b1,

could you please rebase?

@eisenmann-b1 eisenmann-b1 force-pushed the passwordless-gdm-complete-uri branch from 4d57013 to 83958ce Compare February 26, 2026 08:31
@ikerexxe ikerexxe self-requested a review February 26, 2026 09:40
@ikerexxe ikerexxe self-assigned this Feb 26, 2026
@ikerexxe
Copy link
Copy Markdown
Contributor

Do you mind updating the design page available at https://github.com/SSSD/sssd.io/blob/master/src/design-pages/passwordless_gdm.rst?

@eisenmann-b1
Copy link
Copy Markdown
Contributor Author

Do you mind updating the design page available at https://github.com/SSSD/sssd.io/blob/master/src/design-pages/passwordless_gdm.rst?

Done.
It's only a small note and an update to the example JSON though, since none of the other methods there go into much detail either.

SSSD/sssd.io#99

@alexey-tikhonov
Copy link
Copy Markdown
Member

@ikerexxe, @eisenmann-b1, hi.

What's the plan here?

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label May 19, 2026
@eisenmann-b1
Copy link
Copy Markdown
Contributor Author

eisenmann-b1 commented May 19, 2026

In the thread of the gnome-shell PR where I made the suggestion, the takeaway was that the PR be merged as is, and the changes for the completeUri be implemented after.

The PR has yet to be merged though, so I am currently waiting for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-backport This should go to target branch only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants