Made remote_providerID optional in lasso_lecp_build_authn_request_msg and in
SWIG Corrected SWIG handling of metadata. Added attribute providerIds to Session in SWIG.
This commit is contained in:
parent
38b810e034
commit
21c603e245
|
@ -71,6 +71,17 @@ lasso_lecp_build_authn_request_envelope_msg(LassoLecp *lecp)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* lasso_lecp_build_authn_request_msg:
|
||||
* @lecp: a LassoLecp
|
||||
* @remote_providerID: the providerID of the identity provider. When NULL, the first
|
||||
* identity provider is used.
|
||||
*
|
||||
* Builds an authentication request. The data for the sending of the request are
|
||||
* stored in msg_url and msg_body (SOAP POST).
|
||||
*
|
||||
* Return value: 0 on success and a negative value otherwise.
|
||||
**/
|
||||
gint
|
||||
lasso_lecp_build_authn_request_msg(LassoLecp *lecp,
|
||||
const gchar *remote_providerID)
|
||||
|
@ -81,10 +92,15 @@ lasso_lecp_build_authn_request_msg(LassoLecp *lecp,
|
|||
g_return_val_if_fail(LASSO_IS_LECP(lecp), -1);
|
||||
|
||||
profile = LASSO_PROFILE(lecp);
|
||||
|
||||
LASSO_PROFILE(lecp)->remote_providerID = g_strdup(remote_providerID);
|
||||
remote_provider = lasso_server_get_provider_ref(LASSO_PROFILE(lecp)->server,
|
||||
LASSO_PROFILE(lecp)->remote_providerID,
|
||||
if (remote_providerID == NULL) {
|
||||
/* profile->remote_providerID = lasso_server_get_first_providerID(profile->server); */
|
||||
}
|
||||
else {
|
||||
profile->remote_providerID = g_strdup(remote_providerID);
|
||||
}
|
||||
|
||||
remote_provider = lasso_server_get_provider_ref(profile->server,
|
||||
profile->remote_providerID,
|
||||
NULL);
|
||||
|
||||
profile->msg_url = lasso_provider_get_singleSignOnServiceURL(remote_provider, NULL);
|
||||
|
|
|
@ -372,7 +372,8 @@ lasso_logout_get_next_providerID(LassoLogout *logout)
|
|||
/**
|
||||
* lasso_logout_init_request:
|
||||
* @logout:
|
||||
* @remote_providerID:
|
||||
* @remote_providerID: the providerID of the identity provider. When NULL, the first
|
||||
* identity provider is used.
|
||||
* @request_method: if set, then it get the protocol profile in metadata
|
||||
* corresponding of this HTTP request method.
|
||||
*
|
||||
|
|
33
swig/Lasso.i
33
swig/Lasso.i
|
@ -898,13 +898,12 @@ typedef struct {
|
|||
#endif
|
||||
%nodefault LassoProvider;
|
||||
typedef struct {
|
||||
%immutable metadata;
|
||||
LassoNode *metadata;
|
||||
|
||||
%extend {
|
||||
/* Attributes */
|
||||
|
||||
%immutable metadata;
|
||||
%newobject metadata;
|
||||
LassoNode *metadata;
|
||||
|
||||
%immutable providerId;
|
||||
%newobject providerId_get;
|
||||
gchar *providerId;
|
||||
|
@ -915,14 +914,6 @@ typedef struct {
|
|||
|
||||
/* Attributes implementations */
|
||||
|
||||
/* metadata */
|
||||
#define LassoProvider_get_metadata LassoProvider_metadata_get
|
||||
LassoNode *LassoProvider_metadata_get(LassoProvider *self) {
|
||||
/* FIXME: The lasso_node_copy is mandatory. Otherwise metadata is not a LassoNode. Is */
|
||||
/* it a bug? If we correct this don't forget to remove newobject above. */
|
||||
return lasso_node_copy(self->metadata);
|
||||
}
|
||||
|
||||
/* providerId */
|
||||
#define LassoProvider_get_providerId LassoProvider_providerId_get
|
||||
gchar *LassoProvider_providerId_get(LassoProvider *self) {
|
||||
|
@ -1019,7 +1010,6 @@ typedef struct {
|
|||
/* Attributes inherited from LassoProvider */
|
||||
|
||||
%immutable metadata;
|
||||
%newobject metadata;
|
||||
LassoNode *metadata;
|
||||
|
||||
/* Attributes */
|
||||
|
@ -1060,9 +1050,7 @@ typedef struct {
|
|||
/* metadata */
|
||||
#define LassoServer_get_metadata LassoServer_metadata_get
|
||||
LassoNode *LassoServer_metadata_get(LassoServer *self) {
|
||||
/* FIXME: The lasso_node_copy is mandatory. Otherwise metadata is not a LassoNode. Is */
|
||||
/* it a bug? If we correct this don't forget to remove newobject above. */
|
||||
return lasso_node_copy(LASSO_PROVIDER(self)->metadata);
|
||||
return LASSO_PROVIDER(self)->metadata;
|
||||
}
|
||||
|
||||
/* Attributes implementations */
|
||||
|
@ -1180,6 +1168,9 @@ typedef struct {
|
|||
%immutable isDirty;
|
||||
gboolean isDirty;
|
||||
|
||||
%immutable providerIds;
|
||||
LassoProviderIds *providerIds;
|
||||
|
||||
/* Constructor, destructor & static methods */
|
||||
|
||||
LassoSession();
|
||||
|
@ -1209,6 +1200,12 @@ gboolean LassoSession_isDirty_get(LassoSession *self) {
|
|||
return self->is_dirty;
|
||||
}
|
||||
|
||||
/* providerIDs */
|
||||
#define LassoSession_get_providerIds LassoSession_providerIds_get
|
||||
LassoProviderIds *LassoSession_providerIds_get(LassoSession *self) {
|
||||
return self->providerIDs;
|
||||
}
|
||||
|
||||
/* Constructors, destructors & static methods implementations */
|
||||
|
||||
#define new_LassoSession lasso_session_new
|
||||
|
@ -1530,7 +1527,7 @@ typedef struct {
|
|||
END_THROW_ERROR
|
||||
|
||||
THROW_ERROR
|
||||
void buildAuthnRequestMsg(gchar *remoteProviderId);
|
||||
void buildAuthnRequestMsg(gchar *remoteProviderId = NULL);
|
||||
END_THROW_ERROR
|
||||
|
||||
THROW_ERROR
|
||||
|
@ -2063,7 +2060,7 @@ typedef struct {
|
|||
END_THROW_ERROR
|
||||
|
||||
THROW_ERROR
|
||||
void buildAuthnRequestMsg(gchar *remoteProviderId);
|
||||
void buildAuthnRequestMsg(gchar *remoteProviderId = NULL);
|
||||
END_THROW_ERROR
|
||||
|
||||
THROW_ERROR
|
||||
|
|
Loading…
Reference in New Issue