From d80148629002c80777d20ecf17666f845d3f9155 Mon Sep 17 00:00:00 2001 From: Iker Pedrosa Date: Tue, 30 Jan 2024 11:32:25 +0100 Subject: [PATCH] Responder: parse GUI reply Parse GUI reply and set the appropriate data in `sss_auth_token` structure. Signed-off-by: Iker Pedrosa --- src/responder/pam/pamsrv_cmd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index 98c59230904..03de1003958 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -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); @@ -1704,6 +1709,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,