summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-06-11 14:11:43 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-06-11 14:11:43 +0000
commit3189467040a7eb60f65176ad2daccd207aa764fd (patch)
treee511b910dff83fc81d18a0073df565ff1cf6c5a6
parent22cc71048634cf06820ffe7a3d367cd9ef69f207 (diff)
add lasso_authn_response_new to set a AuthnResponse from a AuthnRequest object
-rw-r--r--lasso/Attic/protocols/authn_response.c39
-rw-r--r--lasso/Attic/protocols/authn_response.h3
2 files changed, 42 insertions, 0 deletions
diff --git a/lasso/Attic/protocols/authn_response.c b/lasso/Attic/protocols/authn_response.c
index 07fd0e73..6b68f2ee 100644
--- a/lasso/Attic/protocols/authn_response.c
+++ b/lasso/Attic/protocols/authn_response.c
@@ -277,6 +277,45 @@ lasso_authn_response_new_from_export(xmlChar *buffer,
}
LassoNode*
+lasso_authn_response_new(char *providerID, LassoNode *request){
+ LassoAuthnResponse *response;
+ xmlChar *id, *time, content;
+
+ g_return_val_if_fail(providerID != NULL, NULL);
+
+ response = g_object_new(LASSO_TYPE_AUTHN_RESPONSE, NULL);
+
+ /* ResponseID */
+ id = lasso_build_unique_id(32);
+ lasso_samlp_response_abstract_set_responseID(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ (const xmlChar *)id);
+ xmlFree(id);
+
+ /* MajorVersion */
+ lasso_samlp_response_abstract_set_majorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lassoLibMajorVersion);
+
+ /* MinorVersion */
+ lasso_samlp_response_abstract_set_minorVersion(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ lassoLibMinorVersion);
+
+ /* IssueInstance */
+ time = lasso_get_current_time();
+ lasso_samlp_response_abstract_set_issueInstance(LASSO_SAMLP_RESPONSE_ABSTRACT(response),
+ (const xmlChar *)time);
+ xmlFree(time);
+
+ /* ProviderID */
+ lasso_lib_authn_response_set_providerID(LASSO_LIB_AUTHN_RESPONSE(response),
+ providerID);
+
+ /* Status Code */
+ lasso_authn_response_set_status(response, lassoSamlStatusCodeSuccess);
+
+ return(response);
+}
+
+LassoNode*
lasso_authn_response_new_from_request_query(gchar *query,
const xmlChar *providerID)
{
diff --git a/lasso/Attic/protocols/authn_response.h b/lasso/Attic/protocols/authn_response.h
index 221a1451..4097ab6c 100644
--- a/lasso/Attic/protocols/authn_response.h
+++ b/lasso/Attic/protocols/authn_response.h
@@ -62,6 +62,9 @@ LASSO_EXPORT LassoNode* lasso_authn_response_new_from_dump (xmlC
LASSO_EXPORT LassoNode* lasso_authn_response_new_from_export (xmlChar *buffer,
gint type);
+LASSO_EXPORT LassoNode* lasso_authn_response_new (char *providerID,
+ LassoNode *request);
+
LASSO_EXPORT LassoNode* lasso_authn_response_new_from_request_query (gchar *query,
const xmlChar *providerID);