1
/* $Id: lib_authn_response.c,v 1.5 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/lib_authn_response.h>
29
Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
31
<xs:element name="AuthnResponse" type="AuthnResponseType"/>
32
<xs:complexType name="AuthnResponseType">
34
<xs:extension base="samlp:ResponseType">
36
<xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/>
37
<xs:element ref="ProviderID"/>
38
<xs:element ref="RelayState" minOccurs="0"/>
40
<xs:attribute ref="consent" use="optional"/>
45
<xs:element name="ProviderID" type="md:entityIDType"/>
46
From liberty-metadata-v1.0.xsd:
47
<xs:simpleType name="entityIDType">
48
<xs:restriction base="xs:anyURI">
49
<xs:maxLength value="1024" id="maxlengthid"/>
52
<xs:element name="RelayState" type="xs:string"/>
56
/*****************************************************************************/
58
/*****************************************************************************/
61
lasso_lib_authn_response_set_consent(LassoLibAuthnResponse *node,
62
const xmlChar *consent)
64
LassoNodeClass *class;
65
g_assert(LASSO_IS_LIB_AUTHN_RESPONSE(node));
66
g_assert(consent != NULL);
68
class = LASSO_NODE_GET_CLASS(node);
69
class->set_prop(LASSO_NODE (node), "consent", consent);
73
lasso_lib_authn_response_set_providerID(LassoLibAuthnResponse *node,
74
const xmlChar *providerID)
76
LassoNodeClass *class;
77
g_assert(LASSO_IS_LIB_AUTHN_RESPONSE(node));
78
g_assert(providerID != NULL);
79
/* FIXME : providerID length SHOULD be <= 1024 */
81
class = LASSO_NODE_GET_CLASS(node);
82
class->new_child(LASSO_NODE (node), "ProviderID", providerID, FALSE);
86
lasso_lib_authn_response_set_relayState(LassoLibAuthnResponse *node,
87
const xmlChar *relayState)
89
LassoNodeClass *class;
90
g_assert(LASSO_IS_LIB_AUTHN_RESPONSE(node));
91
g_assert(relayState != NULL);
93
class = LASSO_NODE_GET_CLASS(node);
94
class->new_child(LASSO_NODE (node), "RelayState", relayState, FALSE);
97
/*****************************************************************************/
98
/* instance and class init functions */
99
/*****************************************************************************/
102
lasso_lib_authn_response_instance_init(LassoLibAuthnResponse *node)
104
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
106
class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
107
class->set_name(LASSO_NODE(node), "AuthnResponse");
111
lasso_lib_authn_response_class_init(LassoLibAuthnResponseClass *klass)
115
GType lasso_lib_authn_response_get_type() {
116
static GType authn_response_type = 0;
118
if (!authn_response_type) {
119
static const GTypeInfo authn_response_info = {
120
sizeof (LassoLibAuthnResponseClass),
123
(GClassInitFunc) lasso_lib_authn_response_class_init,
126
sizeof(LassoLibAuthnResponse),
128
(GInstanceInitFunc) lasso_lib_authn_response_instance_init,
131
authn_response_type = g_type_register_static(LASSO_TYPE_SAMLP_RESPONSE,
132
"LassoLibAuthnResponse",
133
&authn_response_info, 0);
135
return authn_response_type;
138
LassoNode* lasso_lib_authn_response_new()
140
return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_AUTHN_RESPONSE, NULL));