diff --git a/lasso/id-ff/profile.c b/lasso/id-ff/profile.c index f2614681..d07e8688 100644 --- a/lasso/id-ff/profile.c +++ b/lasso/id-ff/profile.c @@ -523,6 +523,74 @@ lasso_profile_get_server(LassoProfile *profile) } +/** + * lasso_profile_get_message_id: + * @profile: a #LassoProfile object + * + * Return the messge ID. + * + * Return value:(transfer full)(allow-none): a newly allocated string or NULL + */ +char* +lasso_profile_get_message_id(LassoProfile *profile) +{ + return g_strdup(profile->private_data->message_id); +} + +/** + * lasso_profile_set_message_id: + * @profile: a #LassoProfile object + * @message_id: the message ID + * + * Set @message_id for the current conversation + * + */ +void +lasso_profile_set_message_id(LassoProfile *profile, const char *message_id) +{ + if (! LASSO_IS_PROFILE(profile)) { + message(G_LOG_LEVEL_CRITICAL, "set_message_id called on something not a" \ + "LassoProfile object: %p", profile); + return; + } + lasso_assign_string(profile->private_data->message_id, message_id); +} + +/** + * lasso_profile_get_idp_list: + * @profile: a #LassoProfile object + * + * Return the messge ID. + * + * Return value: a #LassoNode, when using SAML 2.0 a #LassoSamlp2IDPList, + * when using ID-FF a #LassoLibIDPList. + */ +LassoNode* +lasso_profile_get_idp_list(LassoProfile *profile) +{ + return profile->private_data->idp_list; +} + +/** + * lasso_profile_set_idp_list: + * @profile: a #LassoProfile object + * @idp_list: a #LassoNode, when using SAML 2.0 a #LassoSamlp2IDPList, + * when using ID-FF a #LassoLibIDPList. + * + * Set @idp_list for the current conversation + * + */ +void +lasso_profile_set_idp_list(LassoProfile *profile, const LassoNode *idp_list) +{ + if (! LASSO_IS_PROFILE(profile)) { + message(G_LOG_LEVEL_CRITICAL, "set_idp_list called on something not a" \ + "LassoProfile object: %p", profile); + return; + } + lasso_assign_gobject(profile->private_data->idp_list, idp_list); +} + /*****************************************************************************/ /* private methods */ /*****************************************************************************/ @@ -891,6 +959,8 @@ instance_init(LassoProfile *profile) profile->private_data->artifact = NULL; profile->private_data->artifact_message = NULL; profile->private_data->signature_hint = LASSO_PROFILE_SIGNATURE_HINT_MAYBE; + profile->private_data->message_id = NULL; + profile->private_data->idp_list = NULL; profile->server = NULL; profile->request = NULL; diff --git a/lasso/id-ff/profile.h b/lasso/id-ff/profile.h index 14a37fb8..a0cc31b0 100644 --- a/lasso/id-ff/profile.h +++ b/lasso/id-ff/profile.h @@ -214,6 +214,13 @@ LASSO_EXPORT lasso_error_t lasso_profile_get_signature_status(LassoProfile *prof LASSO_EXPORT char* lasso_profile_get_issuer(const char *message); LASSO_EXPORT char* lasso_profile_get_in_response_to(const char *message); +LASSO_EXPORT char* lasso_profile_get_message_id(LassoProfile *profile); +LASSO_EXPORT void lasso_profile_set_message_id(LassoProfile *profile, const char *message_id); + +LASSO_EXPORT LassoNode* lasso_profile_get_idp_list(LassoProfile *profile); +LASSO_EXPORT void lasso_profile_set_idp_list(LassoProfile *profile, const LassoNode *idp_list); + + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/lasso/id-ff/profileprivate.h b/lasso/id-ff/profileprivate.h index 58210573..8527ca52 100644 --- a/lasso/id-ff/profileprivate.h +++ b/lasso/id-ff/profileprivate.h @@ -38,6 +38,8 @@ struct _LassoProfilePrivate gboolean dispose_has_run; LassoProfileSignatureHint signature_hint; LassoProfileSignatureVerifyHint signature_verify_hint; + gchar *message_id; + LassoNode *idp_list; }; void lasso_profile_set_response_status(LassoProfile *profile, const gchar *statusCodeValue);