diff options
| author | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-01 13:54:19 +0000 |
|---|---|---|
| committer | Valery Febvre <vfebvre at easter-eggs.com> | 2004-07-01 13:54:19 +0000 |
| commit | d6001f9251eed28a2fc4e0bd9da224a3155a452e (patch) | |
| tree | 00c3e449c30d37d1d627de2aefb47765ee3dca90 | |
| parent | 6bdf97f01ddde750415b02cb1e235d836d125e1a (diff) | |
| download | lasso-d6001f9251eed28a2fc4e0bd9da224a3155a452e.tar.gz lasso-d6001f9251eed28a2fc4e0bd9da224a3155a452e.tar.xz lasso-d6001f9251eed28a2fc4e0bd9da224a3155a452e.zip | |
*** empty log message ***
| -rw-r--r-- | lasso/Attic/protocols/elements/authentication_statement.c | 13 | ||||
| -rw-r--r-- | lasso/Attic/protocols/identity.c | 10 | ||||
| -rw-r--r-- | lasso/Attic/protocols/identity.h | 4 | ||||
| -rw-r--r-- | lasso/id-ff/authentication.c | 4 |
4 files changed, 22 insertions, 9 deletions
diff --git a/lasso/Attic/protocols/elements/authentication_statement.c b/lasso/Attic/protocols/elements/authentication_statement.c index dd391acf..a99c4ec6 100644 --- a/lasso/Attic/protocols/elements/authentication_statement.c +++ b/lasso/Attic/protocols/elements/authentication_statement.c @@ -72,9 +72,12 @@ lasso_authentication_statement_new(const xmlChar *authenticationMethod LassoSamlNameIdentifier *identifier, LassoSamlNameIdentifier *idp_identifier) { + g_return_val_if_fail(idp_identifier != NULL, NULL); + LassoNode *statement; LassoNode *subject, *subject_confirmation; - xmlChar *time; + gchar *str; + xmlChar *time; statement = LASSO_NODE(g_object_new(LASSO_TYPE_AUTHENTICATION_STATEMENT, NULL)); @@ -88,6 +91,14 @@ lasso_authentication_statement_new(const xmlChar *authenticationMethod reauthenticateOnOrAfter); subject = lasso_lib_subject_new(); + if (identifier == NULL) { + identifier = lasso_saml_name_identifier_new(lasso_node_get_content(LASSO_NODE(idp_identifier))); + str = lasso_node_get_attr_value(LASSO_NODE(idp_identifier), "NameQualifier"); + if (str != NULL) { + lasso_saml_name_identifier_set_nameQualifier(LASSO_SAML_NAME_IDENTIFIER(identifier), str); + xmlFree(str); + } + } lasso_saml_subject_set_nameIdentifier(LASSO_SAML_SUBJECT(subject), LASSO_SAML_NAME_IDENTIFIER(identifier)); lasso_lib_subject_set_idpProvidedNameIdentifier(LASSO_LIB_SUBJECT(subject), diff --git a/lasso/Attic/protocols/identity.c b/lasso/Attic/protocols/identity.c index ad6129ff..783a2c48 100644 --- a/lasso/Attic/protocols/identity.c +++ b/lasso/Attic/protocols/identity.c @@ -29,8 +29,8 @@ /*****************************************************************************/ gint -lasso_identity_set_local_name_identifier(LassoIdentity *identity, - LassoNode *nameIdentifier) +lasso_identity_set_local_nameIdentifier(LassoIdentity *identity, + LassoNode *nameIdentifier) { identity->local_nameIdentifier = nameIdentifier; } @@ -86,10 +86,10 @@ lasso_identity_new(gchar *remote_providerID) { LassoIdentity *identity; - identity = g_object_new(LASSO_TYPE_IDENTITY, NULL); + identity = LASSO_IDENTITY(g_object_new(LASSO_TYPE_IDENTITY, NULL)); - identity->remote_providerID = (char *)malloc(strlen(remote_providerID)+1); - sprintf(identity->remote_providerID, "%s", remote_providerID); + identity->remote_providerID = g_strdup(remote_providerID); + //sprintf(identity->remote_providerID, "%s", remote_providerID); return(identity); } diff --git a/lasso/Attic/protocols/identity.h b/lasso/Attic/protocols/identity.h index 520fd611..3e1ee126 100644 --- a/lasso/Attic/protocols/identity.h +++ b/lasso/Attic/protocols/identity.h @@ -62,8 +62,8 @@ LASSO_EXPORT GType lasso_identity_get_type(void); LASSO_EXPORT LassoIdentity* lasso_identity_new (gchar *remote_providerID); -LASSO_EXPORT gint lasso_identity_set_local_name_identifier (LassoIdentity *identity, - LassoNode *nameIdentifier); +LASSO_EXPORT gint lasso_identity_set_local_nameIdentifier (LassoIdentity *identity, + LassoNode *nameIdentifier); LASSO_EXPORT gint lasso_identity_set_remote_nameIdentifier (LassoIdentity *identity, LassoNode *nameIdentifier); diff --git a/lasso/id-ff/authentication.c b/lasso/id-ff/authentication.c index c3909045..b435ae8b 100644 --- a/lasso/id-ff/authentication.c +++ b/lasso/id-ff/authentication.c @@ -220,7 +220,8 @@ lasso_authentication_build_response_msg(LassoAuthentication *authn, if (identity == NULL) { identity = lasso_identity_new(LASSO_PROFILE_CONTEXT(authn)->remote_providerID); idpProvidedNameIdentifier = LASSO_NODE(lasso_lib_idp_provided_name_identifier_new(lasso_build_unique_id(32))); - lasso_identity_set_local_name_identifier(identity, idpProvidedNameIdentifier); + /* TODO : set nameQualifier and Format */ + lasso_identity_set_local_nameIdentifier(identity, idpProvidedNameIdentifier); } } else if (xmlStrEqual(nameIDPolicy, lassoLibNameIDPolicyTypeOneTime)) { @@ -238,6 +239,7 @@ lasso_authentication_build_response_msg(LassoAuthentication *authn, identity->local_nameIdentifier); lasso_saml_assertion_add_authenticationStatement(assertion, authentication_statement); + printf(lasso_node_export(assertion)); lasso_samlp_response_add_assertion(LASSO_SAMLP_RESPONSE(LASSO_PROFILE_CONTEXT(authn)->response), assertion); } |
