Skip to content

Responder: Add completeUri in EIdP JSON message#8422

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

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

Conversation

@eisenmann-b1
Copy link
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

@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.

"role", "eidp",
"initPrompt", auth_data->oauth2->init_prompt,
"linkPrompt", auth_data->oauth2->link_prompt,
"completeUri", auth_data->oauth2->complete_uri,

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
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
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
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

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