1
/* $Id: lib_logout_request.c,v 1.6 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_logout_request.h>
29
The Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
31
<xs:element name="LogoutRequest" type="LogoutRequestType"/>
32
<xs:complexType name="LogoutRequestType">
34
<xs:extension base="samlp:RequestAbstractType">
36
<xs:element ref="Extension" minOccurs="0" maxOccurs="unbounded"/>
37
<xs:element ref="ProviderID"/>
38
<xs:element ref="saml:NameIdentifier"/>
39
<xs:element name="SessionIndex" type="xs:string" minOccurs="0"/>
40
<xs:element ref="RelayState" minOccurs="0"/>
42
<xs:attribute ref="consent" use="optional"/>
47
<xs:element name="ProviderID" type="md:entityIDType"/>
48
<xs:element name="RelayState" type="xs:string"/>
50
From liberty-metadata-v1.0.xsd:
51
<xs:simpleType name="entityIDType">
52
<xs:restriction base="xs:anyURI">
53
<xs:maxLength value="1024" id="maxlengthid"/>
59
/*****************************************************************************/
61
/*****************************************************************************/
63
lasso_lib_logout_request_set_consent(LassoLibLogoutRequest *node,
64
const xmlChar *consent)
66
LassoNodeClass *class;
67
g_assert(LASSO_IS_LIB_LOGOUT_REQUEST(node));
68
g_assert(consent != NULL);
70
class = LASSO_NODE_GET_CLASS(node);
71
class->set_prop(LASSO_NODE (node), "consent", consent);
75
lasso_lib_logout_request_set_nameIdentifier(LassoLibLogoutRequest *node,
76
LassoSamlNameIdentifier *nameIdentifier)
78
LassoNodeClass *class;
79
g_assert(LASSO_IS_LIB_LOGOUT_REQUEST(node));
80
g_assert(LASSO_IS_SAML_NAME_IDENTIFIER(nameIdentifier));
82
class = LASSO_NODE_GET_CLASS(node);
83
class->add_child(LASSO_NODE (node), LASSO_NODE (nameIdentifier), FALSE);
87
lasso_lib_logout_request_set_providerID(LassoLibLogoutRequest *node,
88
const xmlChar *providerID)
90
LassoNodeClass *class;
91
g_assert(LASSO_IS_LIB_LOGOUT_REQUEST(node));
92
g_assert(providerID != NULL);
93
/* FIXME : providerID length SHOULD be <= 1024 */
95
class = LASSO_NODE_GET_CLASS(node);
96
class->new_child(LASSO_NODE (node), "ProviderID", providerID, FALSE);
100
lasso_lib_logout_request_set_relayState(LassoLibLogoutRequest *node,
101
const xmlChar *relayState)
103
LassoNodeClass *class;
104
g_assert(LASSO_IS_LIB_LOGOUT_REQUEST(node));
105
g_assert(relayState != NULL);
107
class = LASSO_NODE_GET_CLASS(node);
108
class->new_child(LASSO_NODE (node), "RelayState", relayState, FALSE);
112
lasso_lib_logout_request_set_sessionIndex(LassoLibLogoutRequest *node,
113
const xmlChar *sessionIndex)
115
LassoNodeClass *class;
116
g_assert(LASSO_IS_LIB_LOGOUT_REQUEST(node));
117
g_assert(sessionIndex != NULL);
119
class = LASSO_NODE_GET_CLASS(node);
120
class->new_child(LASSO_NODE (node), "SessionIndex", sessionIndex, FALSE);
123
/*****************************************************************************/
124
/* instance and class init functions */
125
/*****************************************************************************/
128
lasso_lib_logout_request_instance_init(LassoLibLogoutRequest *node)
130
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
132
class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
133
class->set_name(LASSO_NODE(node), "LogoutRequest");
137
lasso_lib_logout_request_class_init(LassoLibLogoutRequestClass *klass)
141
GType lasso_lib_logout_request_get_type() {
142
static GType this_type = 0;
145
static const GTypeInfo this_info = {
146
sizeof (LassoLibLogoutRequestClass),
149
(GClassInitFunc) lasso_lib_logout_request_class_init,
152
sizeof(LassoLibLogoutRequest),
154
(GInstanceInitFunc) lasso_lib_logout_request_instance_init,
157
this_type = g_type_register_static(LASSO_TYPE_SAMLP_REQUEST_ABSTRACT,
158
"LassoLibLogoutRequest",
164
LassoNode* lasso_lib_logout_request_new() {
165
return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_LOGOUT_REQUEST,