1 /* $Id$
2  *
3  * Lasso - A free implementation of the Liberty Alliance specifications.
4  *
5  * Copyright (C) 2004-2007 Entr'ouvert
6  * http://lasso.entrouvert.org
7  *
8  * Authors: See AUTHORS file in top-level directory.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef __LASSO_SAMLP2_NAME_ID_POLICY_H__
25 #define __LASSO_SAMLP2_NAME_ID_POLICY_H__
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 
31 #include "../xml.h"
32 
33 #define LASSO_TYPE_SAMLP2_NAME_ID_POLICY (lasso_samlp2_name_id_policy_get_type())
34 #define LASSO_SAMLP2_NAME_ID_POLICY(obj) \
35 	(G_TYPE_CHECK_INSTANCE_CAST((obj), LASSO_TYPE_SAMLP2_NAME_ID_POLICY, \
36 				LassoSamlp2NameIDPolicy))
37 #define LASSO_SAMLP2_NAME_ID_POLICY_CLASS(klass) \
38 	(G_TYPE_CHECK_CLASS_CAST((klass), LASSO_TYPE_SAMLP2_NAME_ID_POLICY, \
39 				LassoSamlp2NameIDPolicyClass))
40 #define LASSO_IS_SAMLP2_NAME_ID_POLICY(obj) \
41 	(G_TYPE_CHECK_INSTANCE_TYPE((obj), LASSO_TYPE_SAMLP2_NAME_ID_POLICY))
42 #define LASSO_IS_SAMLP2_NAME_ID_POLICY_CLASS(klass) \
43 	(G_TYPE_CHECK_CLASS_TYPE ((klass), LASSO_TYPE_SAMLP2_NAME_ID_POLICY))
44 #define LASSO_SAMLP2_NAME_ID_POLICY_GET_CLASS(o) \
45 	(G_TYPE_INSTANCE_GET_CLASS ((o), LASSO_TYPE_SAMLP2_NAME_ID_POLICY, \
46 				LassoSamlp2NameIDPolicyClass))
47 
48 typedef struct _LassoSamlp2NameIDPolicy LassoSamlp2NameIDPolicy;
49 typedef struct _LassoSamlp2NameIDPolicyClass LassoSamlp2NameIDPolicyClass;
50 
51 /**
52  * LassoSamlp2NameIDPolicy:
53  * @Format: the name-identifier format, see #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_EMAIL,
54  * #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_X509, #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_WINDOWS,
55  * #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_KERBEROS, #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_ENTITY,
56  * #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_PERSISTENT, #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_TRANSIENT or
57  * #LASSO_SAML2_NAME_IDENTIFIER_FORMAT_ENCRYPTED.
58  * @SPNameQualifier: other providerID to use as SPNameQualifier in the returned assertion. By
59  * default an IdP create a NameID for the requesting entity, this field allows to obtain a NameID
60  * qualified for a third party.
61  * @AllowCreate: authorize the identity provider to create a new federation, otherwise it must
62  * report a failure in case no existing federation is found (status code of
63  * #LASSO_LIB_STATUS_CODE_FEDERATION_DOES_NOT_EXIST and error code of
64  * #LASSO_PROFILE_ERROR_FEDERATION_NOT_FOUND).
65  *
66  * NameIDPolicy element is part of AuthnRequest and allows to give hint to the identity provider
67  * about the NameID the service provider desire to receive.
68  */
69 struct _LassoSamlp2NameIDPolicy {
70 	LassoNode parent;
71 
72 	/*< public >*/
73 	/* attributes */
74 	char *Format;
75 	char *SPNameQualifier;
76 	gboolean AllowCreate;
77 };
78 
79 
80 struct _LassoSamlp2NameIDPolicyClass {
81 	LassoNodeClass parent;
82 };
83 
84 LASSO_EXPORT GType lasso_samlp2_name_id_policy_get_type(void);
85 LASSO_EXPORT LassoNode* lasso_samlp2_name_id_policy_new(void);
86 
87 
88 
89 #ifdef __cplusplus
90 }
91 #endif /* __cplusplus */
92 
93 #endif /* __LASSO_SAMLP2_NAME_ID_POLICY_H__ */
94