Added some cosmetics, comment headers, #ifdef ...
This commit is contained in:
parent
78dd82b5c7
commit
f99071c554
|
@ -27,8 +27,8 @@
|
|||
|
||||
LassoNode *lasso_build_authnRequest(const xmlChar *providerID,
|
||||
const xmlChar *nameIDPolicy,
|
||||
const xmlChar *isPassive,
|
||||
const xmlChar *forceAuthn,
|
||||
const xmlChar *isPassive,
|
||||
const xmlChar *assertionConsumerServiceID,
|
||||
const xmlChar **authnContextClassRefs,
|
||||
const xmlChar **authnContextStatementRefs,
|
||||
|
@ -37,19 +37,82 @@ LassoNode *lasso_build_authnRequest(const xmlChar *providerID,
|
|||
const xmlChar *proxyCount,
|
||||
const xmlChar **idpList,
|
||||
const xmlChar *consent)
|
||||
{
|
||||
lasso_build_full_authnRequest(NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
providerID,
|
||||
nameIDPolicy,
|
||||
forceAuthn,
|
||||
isPassive,
|
||||
assertionConsumerServiceID,
|
||||
authnContextClassRefs,
|
||||
authnContextStatementRefs,
|
||||
authnContextComparison,
|
||||
relayState,
|
||||
proxyCount,
|
||||
idpList,
|
||||
consent);
|
||||
}
|
||||
|
||||
LassoNode *lasso_build_full_authnRequest(const xmlChar *requestID,
|
||||
const xmlChar *majorVersion,
|
||||
const xmlChar *minorVersion,
|
||||
const xmlChar *issueInstant,
|
||||
const xmlChar *providerID,
|
||||
const xmlChar *nameIDPolicy,
|
||||
const xmlChar *forceAuthn,
|
||||
const xmlChar *isPassive,
|
||||
const xmlChar *assertionConsumerServiceID,
|
||||
const xmlChar **authnContextClassRefs,
|
||||
const xmlChar **authnContextStatementRefs,
|
||||
const xmlChar *authnContextComparison,
|
||||
const xmlChar *relayState,
|
||||
const xmlChar *proxyCount,
|
||||
const xmlChar **idpList,
|
||||
const xmlChar *consent)
|
||||
{
|
||||
LassoNode *request;
|
||||
|
||||
// build AuthnRequest class
|
||||
request = lasso_lib_authn_request_new();
|
||||
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
(const xmlChar *)lasso_build_unique_id(32));
|
||||
lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
lassoLibMinorVersion);
|
||||
lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
lasso_get_current_time());
|
||||
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
lassoLibMajorVersion);
|
||||
|
||||
if (requestID != NULL) {
|
||||
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
requestID);
|
||||
}
|
||||
else {
|
||||
lasso_samlp_request_abstract_set_requestID(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
(const xmlChar *)lasso_build_unique_id(32));
|
||||
}
|
||||
|
||||
if (majorVersion != NULL) {
|
||||
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
majorVersion);
|
||||
}
|
||||
else {
|
||||
lasso_samlp_request_abstract_set_majorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
lassoLibMajorVersion);
|
||||
}
|
||||
|
||||
if (minorVersion != NULL) {
|
||||
lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
minorVersion);
|
||||
}
|
||||
else {
|
||||
lasso_samlp_request_abstract_set_minorVersion(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
lassoLibMinorVersion);
|
||||
}
|
||||
|
||||
if (issueInstant != NULL) {
|
||||
lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
issueInstant);
|
||||
}
|
||||
else {
|
||||
lasso_samlp_request_abstract_set_issueInstance(LASSO_SAMLP_REQUEST_ABSTRACT(request),
|
||||
lasso_get_current_time());
|
||||
}
|
||||
|
||||
lasso_lib_authn_request_set_providerID(LASSO_LIB_AUTHN_REQUEST(request),
|
||||
providerID);
|
||||
|
@ -58,14 +121,14 @@ LassoNode *lasso_build_authnRequest(const xmlChar *providerID,
|
|||
lasso_lib_authn_request_set_nameIDPolicy(LASSO_LIB_AUTHN_REQUEST(request), nameIDPolicy);
|
||||
}
|
||||
|
||||
if(isPassive != NULL) {
|
||||
lasso_lib_authn_request_set_isPassive(LASSO_LIB_AUTHN_REQUEST(request), isPassive);
|
||||
}
|
||||
|
||||
if(forceAuthn != NULL) {
|
||||
lasso_lib_authn_request_set_forceAuthn(LASSO_LIB_AUTHN_REQUEST(request), forceAuthn);
|
||||
}
|
||||
|
||||
if(isPassive != NULL) {
|
||||
lasso_lib_authn_request_set_isPassive(LASSO_LIB_AUTHN_REQUEST(request), isPassive);
|
||||
}
|
||||
|
||||
if(assertionConsumerServiceID != NULL) {
|
||||
lasso_lib_authn_request_set_assertionConsumerServiceID(LASSO_LIB_AUTHN_REQUEST(request),
|
||||
assertionConsumerServiceID);
|
||||
|
|
|
@ -1,13 +1,40 @@
|
|||
#ifndef SINGLE_SIGN_ON_AND_FEDERATION_H
|
||||
#define SINGLE_SIGN_ON_AND_FEDERATION_H
|
||||
/* $Id$
|
||||
*
|
||||
* Lasso - A free implementation of the Liberty Alliance specifications.
|
||||
*
|
||||
* Copyright (C) 2004 Entr'ouvert
|
||||
* http://lasso.entrouvert.org
|
||||
*
|
||||
* Author: Valery Febvre <vfebvre@easter-eggs.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef __LASSO_SINGLE_SIGN_ON_AND_FEDERATION_H__
|
||||
#define __LASSO_SINGLE_SIGN_ON_AND_FEDERATION_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <lasso/lasso.h>
|
||||
#include <glib.h>
|
||||
|
||||
LassoNode *lasso_build_authnRequest(const xmlChar *providerID,
|
||||
const xmlChar *nameIDPolicy,
|
||||
const xmlChar *isPassive,
|
||||
const xmlChar *forceAuthn,
|
||||
const xmlChar *isPassive,
|
||||
const xmlChar *assertionConsumerServiceID,
|
||||
const xmlChar **authnContextClassRefs,
|
||||
const xmlChar **authnContextStatementRefs,
|
||||
|
@ -22,4 +49,9 @@ LassoNode *lasso_build_authnResponse(LassoNode *request,
|
|||
|
||||
LassoNode *lasso_build_response(LassoNode *request,
|
||||
const xmlChar *providerID);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __LASSO_SINGLE_SIGN_ON_AND_FEDERATION_H__ */
|
||||
|
|
Loading…
Reference in New Issue