Skip to content

Commit

Permalink
Responder: include selectable
Browse files Browse the repository at this point in the history
Include `selectable` field in the JSON message sent by SSSD.

Signed-off-by: Iker Pedrosa <[email protected]>
  • Loading branch information
ikerexxe committed Apr 19, 2024
1 parent 898fb59 commit 21ad3e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/responder/pam/pamsrv_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ json_format_mechanisms(bool password_auth, const char *password_prompt,
}

if (password_auth) {
json_pass = json_pack("{s:s,s:s,s:s}",
json_pass = json_pack("{s:s,s:s,s:b,s:s}",
"name", "Password",
"role", "password",
"selectable", true,
"prompt", password_prompt);
if (json_pass == NULL) {
DEBUG(SSSDBG_OP_FAILURE, "json_pack failed.\n");
Expand All @@ -139,9 +140,10 @@ json_format_mechanisms(bool password_auth, const char *password_prompt,
}

if (oauth2_auth) {
json_oauth2 = json_pack("{s:s,s:s,s:s,s:s,s:s,s:s,s:i}",
json_oauth2 = json_pack("{s:s,s:s,s:b,s:s,s:s,s:s,s:s,s:i}",
"name", "Web Login",
"role", "eidp",
"selectable", true,
"init_prompt", "Log In",
"link_prompt", "Log in online with another device",
"uri", uri,
Expand Down
4 changes: 2 additions & 2 deletions src/tests/cmocka/test_pamsrv_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@

#define BASIC_PASSWORD "\"password\": {" \
"\"name\": \"Password\", \"role\": \"password\", " \
"\"prompt\": \"Password\"}"
"\"selectable\": true, \"prompt\": \"Password\"}"
#define BASIC_OAUTH2 "\"eidp\": {" \
"\"name\": \"Web Login\", \"role\": \"eidp\", " \
"\"init_prompt\": \"Log In\", " \
"\"selectable\": true, \"init_prompt\": \"Log In\", " \
"\"link_prompt\": \"Log in online with another device\", " \
"\"uri\": \"short.url.com/tmp\", \"code\": \"1234-5678\", " \
"\"timeout\": 300}"
Expand Down

0 comments on commit 21ad3e1

Please sign in to comment.