1
/* $Id: samlp_response.c,v 1.7 2004/08/13 15:16:13 fpeters Exp $
3
* Lasso - A free implementation of the Liberty Alliance specifications.
5
* Copyright (C) 2004 Entr'ouvert
6
* http://lasso.entrouvert.org
8
* Authors: Nicolas Clapies <nclapies@entrouvert.com>
9
* Valery Febvre <vfebvre@easter-eggs.com>
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* (at your option) any later version.
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with this program; if not, write to the Free Software
23
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
#include <lasso/xml/samlp_response.h>
29
Schema fragment (oasis-sstc-saml-schema-protocol-1.0.xsd):
31
<element name="Response" type="samlp:ResponseType"/>
32
<complexType name="ResponseType">
34
<extension base="samlp:ResponseAbstractType">
36
<element ref="samlp:Status"/>
37
<element ref="saml:Assertion" minOccurs="0" maxOccurs="unbounded"/>
45
/*****************************************************************************/
47
/*****************************************************************************/
50
lasso_samlp_response_add_assertion(LassoSamlpResponse *node,
53
LassoNodeClass *class;
54
g_assert(LASSO_IS_SAMLP_RESPONSE(node));
55
/* g_assert(LASSO_IS_SAML_ASSERTION(assertion)); */
57
class = LASSO_NODE_GET_CLASS(node);
58
class->add_child(LASSO_NODE (node), LASSO_NODE(assertion), TRUE);
62
lasso_samlp_response_set_status(LassoSamlpResponse *node,
63
LassoSamlpStatus *status)
65
LassoNodeClass *class;
66
g_assert(LASSO_IS_SAMLP_RESPONSE(node));
67
g_assert(LASSO_IS_SAMLP_STATUS(status));
69
class = LASSO_NODE_GET_CLASS(node);
70
class->add_child(LASSO_NODE (node), LASSO_NODE(status), FALSE);
73
/*****************************************************************************/
74
/* instance and class init functions */
75
/*****************************************************************************/
78
lasso_samlp_response_instance_init(LassoSamlpResponse *node)
80
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
82
/* namespace herited from samlp:ResponseAbstract */
83
class->set_name(LASSO_NODE(node), "Response");
87
lasso_samlp_response_class_init(LassoSamlpResponseClass *klass) {
90
GType lasso_samlp_response_get_type() {
91
static GType response_type = 0;
94
static const GTypeInfo response_info = {
95
sizeof (LassoSamlpResponseClass),
98
(GClassInitFunc) lasso_samlp_response_class_init,
101
sizeof(LassoSamlpResponse),
103
(GInstanceInitFunc) lasso_samlp_response_instance_init,
106
response_type = g_type_register_static(LASSO_TYPE_SAMLP_RESPONSE_ABSTRACT ,
107
"LassoSamlpResponse",
110
return response_type;
113
LassoNode* lasso_samlp_response_new()
115
return LASSO_NODE(g_object_new(LASSO_TYPE_SAMLP_RESPONSE, NULL));