Skip to content

Commit

Permalink
Responder: parse GUI reply
Browse files Browse the repository at this point in the history
Parse GUI reply and set the appropriate data in `sss_auth_token`
structure.

Signed-off-by: Iker Pedrosa <[email protected]>
  • Loading branch information
ikerexxe committed Mar 6, 2024
1 parent db9a2e1 commit 9f69590
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/responder/pam/pamsrv_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,11 @@ static int pam_parse_in_data_v2(struct pam_data *pd,
body, blen, &c);
if (ret != EOK) return ret;
break;
case SSS_PAM_ITEM_JSON_AUTH_SELECTED:
ret = extract_string(&pd->json_auth_selected, size, body,
blen, &c);
if (ret != EOK) return ret;
break;
default:
DEBUG(SSSDBG_CRIT_FAILURE,
"Ignoring unknown data type [%d].\n", type);
Expand Down Expand Up @@ -1714,6 +1719,17 @@ static errno_t pam_forwarder_parse_data(struct cli_ctx *cctx, struct pam_data *p
goto done;
}

#ifdef HAVE_GDM_CUSTOM_JSON_PAM_EXTENSION
if (pd->cmd == SSS_PAM_AUTHENTICATE
&& pd->json_auth_selected != NULL) {
ret = json_unpack_auth_reply(pd);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "json_unpack_auth_reply failed.\n");
goto done;
}
}
#endif /* HAVE_GDM_CUSTOM_JSON_PAM_EXTENSION */

if (pd->logon_name != NULL) {
ret = sss_parse_name_for_domains(pd, cctx->rctx->domains,
cctx->rctx->default_domain,
Expand Down

0 comments on commit 9f69590

Please sign in to comment.