LassoLecp

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

## Synopsis

    struct              LassoLecp;
    LassoLecp *         lasso_lecp_new                      (LassoServer *server);
    lasso_error_t       lasso_lecp_build_authn_request_envelope_msg
                                                            (LassoLecp *lecp);
    lasso_error_t       lasso_lecp_build_authn_request_msg  (LassoLecp *lecp);
    lasso_error_t       lasso_lecp_build_authn_response_msg (LassoLecp *lecp);
    lasso_error_t       lasso_lecp_build_authn_response_envelope_msg
                                                            (LassoLecp *lecp);
    void                lasso_lecp_destroy                  (LassoLecp *lecp);
    lasso_error_t       lasso_lecp_init_authn_request       (LassoLecp *lecp,
                                                             const char *remote_providerID);
    lasso_error_t       lasso_lecp_process_authn_request_msg
                                                            (LassoLecp *lecp,
                                                             const char *authn_request_msg);
    lasso_error_t       lasso_lecp_process_authn_request_envelope_msg
                                                            (LassoLecp *lecp,
                                                             const char *request_msg);
    lasso_error_t       lasso_lecp_process_authn_response_envelope_msg
                                                            (LassoLecp *lecp,
                                                             const char *response_msg);

## Description

## Details

### struct LassoLecp

    struct LassoLecp {
    	LassoLogin parent;

    	LassoLibAuthnRequestEnvelope *authnRequestEnvelope;
    	LassoLibAuthnResponseEnvelope *authnResponseEnvelope;
    	char *assertionConsumerServiceURL;
    };

### lasso_lecp_new ()

    LassoLecp *         lasso_lecp_new                      (LassoServer *server);

Creates a new LassoLecp.

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

### lasso_lecp_build_authn_request_envelope_msg ()

    lasso_error_t       lasso_lecp_build_authn_request_envelope_msg
                                                            (LassoLecp *lecp);

Builds an enveloped authentication request message. Sets `msg_body` to that message.

`lecp` : | a LassoLecp
Returns : | 0 on success; or a negative value otherwise.

### lasso_lecp_build_authn_request_msg ()

    lasso_error_t       lasso_lecp_build_authn_request_msg  (LassoLecp *lecp);

Builds an authentication request. The data for the sending of the request are stored in `msg_url` and `msg_body` (SOAP POST).

`lecp` : | a LassoLecp
Returns : | 0 on success; or a negative value otherwise.

### lasso_lecp_build_authn_response_msg ()

    lasso_error_t       lasso_lecp_build_authn_response_msg (LassoLecp *lecp);

Builds the lecp authentication response message (base64). Sets `msg_body` to that message.

`lecp` : | a LassoLecp
Returns : | 0 on success; or a negative value otherwise.

### lasso_lecp_build_authn_response_envelope_msg ()

    lasso_error_t       lasso_lecp_build_authn_response_envelope_msg
                                                            (LassoLecp *lecp);

Builds the enveloped LECP authentication response message (SOAP message). Sets `msg_body` to that message.

`lecp` : | a LassoLecp
Returns : | 0 on success; or a negative value otherwise.

### lasso_lecp_destroy ()

    void                lasso_lecp_destroy                  (LassoLecp *lecp);

Destroys a LassoLecp object

`lecp` : | a LassoLecp

### lasso_lecp_init_authn_request ()

    lasso_error_t       lasso_lecp_init_authn_request       (LassoLecp *lecp,
                                                             const char *remote_providerID);

Initializes a new lib:AuthnRequest.

`lecp` : | a LassoLecp
`remote_providerID` : | the providerID of the identity provider. When NULL, the first known identity provider is used.
Returns : | 0 on success; or a negative value otherwise.

### lasso_lecp_process_authn_request_msg ()

    lasso_error_t       lasso_lecp_process_authn_request_msg
                                                            (LassoLecp *lecp,
                                                             const char *authn_request_msg);

Processes received authentication request, checks it is signed correctly, checks if requested protocol profile is supported, etc.

`lecp` : | a LassoLecp
`authn_request_msg` : | the authentication request received
Returns : | 0 on success; or a negative value otherwise.

### lasso_lecp_process_authn_request_envelope_msg ()

    lasso_error_t       lasso_lecp_process_authn_request_envelope_msg
                                                            (LassoLecp *lecp,
                                                             const char *request_msg);

Processes received enveloped authentication request, extracts the authentication request out of it.

`lecp` : | a LassoLecp
`request_msg` : | the enveloped authentication request received
Returns : | 0 on success; or a negative value otherwise.

### lasso_lecp_process_authn_response_envelope_msg ()

    lasso_error_t       lasso_lecp_process_authn_response_envelope_msg
                                                            (LassoLecp *lecp,
                                                             const char *response_msg);

Processes received enveloped authentication response, extracts the authentication response out of it and stores it in `response`.

`lecp` : | a LassoLecp
`response_msg` : | the enveloped authentication response received
Returns : | 0 on success; or a negative value otherwise.