LassoNameRegistration

LassoNameRegistration — Name Registration Profile (ID-FF)

Synopsis


#include <lasso/lasso.h>

                    LassoNameRegistration;
LassoNameRegistration* lasso_name_registration_new      (LassoServer *server);
void                lasso_name_registration_destroy     (LassoNameRegistration *name_registration);
LassoNameRegistration* lasso_name_registration_new_from_dump
                                                        (LassoServer *server,
                                                         const char *dump);
gint                lasso_name_registration_build_request_msg
                                                        (LassoNameRegistration *name_registration);
gint                lasso_name_registration_build_response_msg
                                                        (LassoNameRegistration *name_registration);
gint                lasso_name_registration_init_request
                                                        (LassoNameRegistration *name_registration,
                                                         char *remote_providerID,
                                                         LassoHttpMethod http_method);
gint                lasso_name_registration_process_request_msg
                                                        (LassoNameRegistration *name_registration,
                                                         gchar *request_msg);
gint                lasso_name_registration_process_response_msg
                                                        (LassoNameRegistration *name_registration,
                                                         gchar *response_msg);
gint                lasso_name_registration_validate_request
                                                        (LassoNameRegistration *name_registration);

Object Hierarchy

  GObject
   +----LassoNode
         +----LassoProfile
               +----LassoNameRegistration

Description

Details

LassoNameRegistration

typedef struct {
	LassoSamlNameIdentifier *oldNameIdentifier;
} LassoNameRegistration;


lasso_name_registration_new ()

LassoNameRegistration* lasso_name_registration_new      (LassoServer *server);

Creates a new LassoNameRegistration.

server : the LassoServer
Returns : a newly created LassoNameRegistration object; or NULL if an error occured

lasso_name_registration_destroy ()

void                lasso_name_registration_destroy     (LassoNameRegistration *name_registration);

Destroys a LassoNameRegistration object.

name_registration : a LassoNameRegistration

lasso_name_registration_new_from_dump ()

LassoNameRegistration* lasso_name_registration_new_from_dump
                                                        (LassoServer *server,
                                                         const char *dump);

Restores the dump to a new LassoNameRegistration.

server : the LassoServer
dump : XML logout dump
Returns : a newly created LassoNameRegistration; or NULL if an error occured

lasso_name_registration_build_request_msg ()

gint                lasso_name_registration_build_request_msg
                                                        (LassoNameRegistration *name_registration);

Builds a register name identifier request message.

It gets the register name identifier protocol profile and:

  • if it is a SOAP method, then it builds the register name identifier request SOAP message, optionally signs his node, sets msg_body, gets the SoapEndpoint url and sets msg_url.

  • if it is a HTTP-Redirect method, then it builds the register name identifier request QUERY message (optionally signs the request message), builds the request url with register name identifier url with register name identifier service url, sets msg_url in the register name identifier object, sets msg_body to NULL.

name_registration : a LassoNameRegistration
Returns : 0 on success; or a negative value otherwise.

lasso_name_registration_build_response_msg ()

gint                lasso_name_registration_build_response_msg
                                                        (LassoNameRegistration *name_registration);

Builds the register name idendifier response message.

It gets the request message method and:

  • if it is a SOAP method, then it builds the response SOAP message, sets the msg_body attribute, gets the register name identifier service return url and sets msg_url of the object.

  • if it is a HTTP-Redirect method, then it builds the response QUERY message, builds the response url, sets msg_url with the response url and sets the msg_body with NULL

If private key and certificate are set in server object it will also signs the message (either with X509 if SOAP or with a simple signature for query strings).

name_registration : a LassoNameRegistration
Returns : 0 on success; or a negative value otherwise.

lasso_name_registration_init_request ()

gint                lasso_name_registration_init_request
                                                        (LassoNameRegistration *name_registration,
                                                         char *remote_providerID,
                                                         LassoHttpMethod http_method);

Initializes a new lib:RegisterNameIdentifierRequest request; it sets name_registration->nameIdentifier to the new name identifier and name_registration->oldNameIdentifier to the old one.

name_registration : a LassoNameRegistration
remote_providerID : the providerID of the identity provider.
http_method : if set, then it get the protocol profile in metadata corresponding of this HTTP request method.
Returns : 0 on success; or a negative value otherwise.

lasso_name_registration_process_request_msg ()

gint                lasso_name_registration_process_request_msg
                                                        (LassoNameRegistration *name_registration,
                                                         gchar *request_msg);

Processes a lib:RegisterNameIdentifierRequest message. Rebuilds a request object from the message and optionally verifies its signature. Sets profile->nameIdentifier to local name identifier. If it changed (when this is IdP-initiated and there was no previously defined local name identifier) profile->nameIdentifier will be the new one and profile->oldNameIdentiifer the old one.

name_registration : a LassoNameRegistration
request_msg : the register name identifier request message
Returns : 0 on success; or a negative value otherwise.

lasso_name_registration_process_response_msg ()

gint                lasso_name_registration_process_response_msg
                                                        (LassoNameRegistration *name_registration,
                                                         gchar *response_msg);

Processes a lib:RegisterNameIdentifierResponse message. Rebuilds a response object from the message and optionally verifies its signature.

If the response depicts Success it will also update Principal federation.

name_registration : a LassoNameRegistration
response_msg : the register name identifier response message
Returns : 0 on success; or a negative value otherwise.

lasso_name_registration_validate_request ()

gint                lasso_name_registration_validate_request
                                                        (LassoNameRegistration *name_registration);

Checks profile request with regards to message status and principal federations, update them accordingly and prepares a lib:RegisterNameIdentifierResponse accordingly.

name_registration : a LassoNameRegistration
Returns : 0 on success; or a negative value otherwise.