LassoNameIdentifierMapping

## LassoNameIdentifierMapping LassoNameIdentifierMapping — Liberty Enabled Client and Proxy Profile (ID-FF) |

## Synopsis

    struct              LassoNameIdentifierMapping;
    LassoNameIdentifierMapping * lasso_name_identifier_mapping_new
                                                            (LassoServer *server);
    lasso_error_t       lasso_name_identifier_mapping_build_request_msg
                                                            (LassoNameIdentifierMapping *mapping);
    lasso_error_t       lasso_name_identifier_mapping_build_response_msg
                                                            (LassoNameIdentifierMapping *mapping);
    void                lasso_name_identifier_mapping_destroy
                                                            (LassoNameIdentifierMapping *mapping);
    lasso_error_t       lasso_name_identifier_mapping_init_request
                                                            (LassoNameIdentifierMapping *mapping,
                                                             gchar *targetNamespace,
                                                             gchar *remote_providerID);
    lasso_error_t       lasso_name_identifier_mapping_process_request_msg
                                                            (LassoNameIdentifierMapping *mapping,
                                                             gchar *request_msg);
    lasso_error_t       lasso_name_identifier_mapping_process_response_msg
                                                            (LassoNameIdentifierMapping *mapping,
                                                             gchar *response_msg);
    lasso_error_t       lasso_name_identifier_mapping_validate_request
                                                            (LassoNameIdentifierMapping *mapping);

## Description

## Details

### struct LassoNameIdentifierMapping

    struct LassoNameIdentifierMapping {
    	LassoProfile parent;

    	gchar *targetNameIdentifier;
    };

### lasso_name_identifier_mapping_new ()

    LassoNameIdentifierMapping * lasso_name_identifier_mapping_new
                                                            (LassoServer *server);

Creates a new LassoNameIdentifierMapping.

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

### lasso_name_identifier_mapping_build_request_msg ()

    lasso_error_t       lasso_name_identifier_mapping_build_request_msg
                                                            (LassoNameIdentifierMapping *mapping);

Builds a name identifier mapping request message.

- If it is a SOAP method, then it builds the request as a SOAP message, optionally signs his node, sets `msg_body` with that message and sets `msg_url` with the SOAP Endpoint URL

- If it is a HTTP-Redirect method, then it builds the request as a query string message, optionally signs it and sets `msg_url` to that URL.

`mapping` : | a LassoNameIdentifierMapping
Returns : | 0 on success; or a negative value otherwise.

### lasso_name_identifier_mapping_build_response_msg ()

    lasso_error_t       lasso_name_identifier_mapping_build_response_msg
                                                            (LassoNameIdentifierMapping *mapping);

Builds a name identifier mapping response message.

- If it is a SOAP method, then it builds the response as a SOAP message, optionally signs his node, sets `msg_body` with that message and sets `msg_url` with the register name identifier service return URL.

- If it is a HTTP-Redirect method, then it builds the response as a query string message, optionally signs it and sets `msg_url` to that URL.

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).

`mapping` : | a LassoNameIdentifierMapping
Returns : | 0 on success; or a negative value otherwise.

### lasso_name_identifier_mapping_destroy ()

    void                lasso_name_identifier_mapping_destroy
                                                            (LassoNameIdentifierMapping *mapping);

Destroys a LassoNameIdentifierMapping object.

`mapping` : | a LassoNameIdentifierMapping

### lasso_name_identifier_mapping_init_request ()

    lasso_error_t       lasso_name_identifier_mapping_init_request
                                                            (LassoNameIdentifierMapping *mapping,
                                                             gchar *targetNamespace,
                                                             gchar *remote_providerID);

Initializes a new lib:NameIdentifierMappingRequest request.

`mapping` : | a LassoNameIdentifierMapping
`targetNamespace` : | the request targetNamespace
`remote_providerID` : | the providerID of the identity provider.
Returns : | 0 on success; or a negative value otherwise.

### lasso_name_identifier_mapping_process_request_msg ()

    lasso_error_t       lasso_name_identifier_mapping_process_request_msg
                                                            (LassoNameIdentifierMapping *mapping,
                                                             gchar *request_msg);

Processes a lib:NameIdentifierMappingRequest message. Rebuilds a request object from the message and optionally verifies its signature.

`mapping` : | a LassoNameIdentifierMapping
`request_msg` : | the name identifier mapping request message
Returns : | 0 on success; or a negative value otherwise.

### lasso_name_identifier_mapping_process_response_msg ()

    lasso_error_t       lasso_name_identifier_mapping_process_response_msg
                                                            (LassoNameIdentifierMapping *mapping,
                                                             gchar *response_msg);

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

If the response depicts Success it will also sets `targetNameIdentifier`.

`mapping` : | a LassoNameIdentifierMapping
`response_msg` : | the name identifier mapping response message
Returns : | 0 on success; or a negative value otherwise.

### lasso_name_identifier_mapping_validate_request ()

    lasso_error_t       lasso_name_identifier_mapping_validate_request
                                                            (LassoNameIdentifierMapping *mapping);

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

`mapping` : | a LassoNameIdentifierMapping
Returns : | 0 on success; or a negative value otherwise.