1
/* $Id: lib_request_authn_context.c,v 1.4 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_request_authn_context.h>
29
Information describing which authentication context the requester desires the
30
identity provider to use in authenticating the Principal.
32
Schema fragment (liberty-idff-protocols-schema-v1.2.xsd):
34
<xs:element name="RequestAuthnContext">
38
<xs:element name="AuthnContextClassRef" type="xs:anyURI" maxOccurs="unbounded"/>
39
<xs:element name="AuthnContextStatementRef" type="xs:anyURI" maxOccurs="unbounded"/>
41
<xs:element name="AuthnContextComparison" type="AuthnContextComparisonType" minOccurs="0"/>
47
/*****************************************************************************/
49
/*****************************************************************************/
52
lasso_lib_request_authn_context_add_authnContextClassRef(LassoLibRequestAuthnContext *node,
53
const xmlChar *authnContextClassRef)
55
LassoNodeClass *class;
56
g_assert(LASSO_IS_LIB_REQUEST_AUTHN_CONTEXT(node));
57
g_assert(authnContextClassRef != NULL);
59
class = LASSO_NODE_GET_CLASS(node);
60
class->new_child(LASSO_NODE (node), "AuthnContextClassRef",
61
authnContextClassRef, TRUE);
65
lasso_lib_request_authn_context_add_authnContextStatementRef(LassoLibRequestAuthnContext *node,
66
const xmlChar *authnContextStatementRef)
68
LassoNodeClass *class;
69
g_assert(LASSO_IS_LIB_REQUEST_AUTHN_CONTEXT(node));
70
g_assert(authnContextStatementRef != NULL);
72
class = LASSO_NODE_GET_CLASS(node);
73
class->new_child(LASSO_NODE (node), "AuthnContextStatementRef",
74
authnContextStatementRef, TRUE);
78
lasso_lib_request_authn_context_set_authnContextComparison(LassoLibRequestAuthnContext *node,
79
const xmlChar *authnContextComparison)
81
LassoNodeClass *class;
82
g_assert(LASSO_IS_LIB_REQUEST_AUTHN_CONTEXT(node));
83
g_assert(authnContextComparison != NULL);
85
class = LASSO_NODE_GET_CLASS(node);
86
class->new_child(LASSO_NODE (node), "AuthnContextComparison",
87
authnContextComparison, FALSE);
90
/*****************************************************************************/
91
/* instance and class init functions */
92
/*****************************************************************************/
95
lasso_lib_request_authn_context_instance_init(LassoLibRequestAuthnContext *node)
97
LassoNodeClass *class = LASSO_NODE_GET_CLASS(LASSO_NODE(node));
99
class->set_ns(LASSO_NODE(node), lassoLibHRef, lassoLibPrefix);
100
class->set_name(LASSO_NODE(node), "RequestAuthnContext");
104
lasso_lib_request_authn_context_class_init(LassoLibRequestAuthnContextClass *klass)
108
GType lasso_lib_request_authn_context_get_type() {
109
static GType this_type = 0;
112
static const GTypeInfo this_info = {
113
sizeof (LassoLibRequestAuthnContextClass),
116
(GClassInitFunc) lasso_lib_request_authn_context_class_init,
119
sizeof(LassoLibRequestAuthnContext),
121
(GInstanceInitFunc) lasso_lib_request_authn_context_instance_init,
124
this_type = g_type_register_static(LASSO_TYPE_NODE,
125
"LassoLibRequestAuthnContext",
131
LassoNode* lasso_lib_request_authn_context_new() {
132
return LASSO_NODE(g_object_new(LASSO_TYPE_LIB_REQUEST_AUTHN_CONTEXT, NULL));