/**
 * lasso_lib_name_identifier_mapping_response_new_full:
 * @providerID: the providerID of the responder
 * @statusCodeValue: a response status code
 * @request: the request which is asnwered by this response
 * @sign_type: a #LassoSignatureType value
 * @sign_method: a #LassoSignatureMethod value
 *
 * Creates a new #LassoLibNameIdentifierMappingResponse object and initializes
 * it with the parameters.
 *
 * Return value: a newly created #LassoLibNameIdentifierMappingResponse object
 **/
LassoNode*
lasso_lib_name_identifier_mapping_response_new_full(char *providerID, const char *statusCodeValue,
		LassoLibNameIdentifierMappingRequest *request,
		LassoSignatureType sign_type, LassoSignatureMethod sign_method)
{
	LassoLibNameIdentifierMappingResponse *response;

	response = g_object_new(LASSO_TYPE_LIB_NAME_IDENTIFIER_MAPPING_RESPONSE, NULL);
	lasso_samlp_response_abstract_fill(
			LASSO_SAMLP_RESPONSE_ABSTRACT(response),
			LASSO_SAMLP_REQUEST_ABSTRACT(request)->RequestID,
			request->ProviderID);
	LASSO_SAMLP_RESPONSE_ABSTRACT(response)->sign_type = sign_type;
	LASSO_SAMLP_RESPONSE_ABSTRACT(response)->sign_method = sign_method;

	response->ProviderID = g_strdup(providerID);
	response->Status = lasso_samlp_status_new();
	response->Status->StatusCode = lasso_samlp_status_code_new();
	response->Status->StatusCode->Value = g_strdup(statusCodeValue);

	return LASSO_NODE(response);
}
Exemple #2
0
/**
 * lasso_samlp_response_new:
 *
 * Creates a new #LassoSamlpResponse object.
 *
 * Return value: a newly created #LassoSamlpResponse object
 **/
LassoNode*
lasso_samlp_response_new()
{
    LassoSamlpResponseAbstract *response;
    LassoSamlpStatusCode *status_code;
    LassoSamlpStatus *status;

    response = g_object_new(LASSO_TYPE_SAMLP_RESPONSE, NULL);

    response->ResponseID = lasso_build_unique_id(32);
    response->MajorVersion = LASSO_SAML_MAJOR_VERSION_N;
    response->MinorVersion = LASSO_SAML_MINOR_VERSION_N;
    response->IssueInstant = lasso_get_current_time();

    /* Add Status */
    status = LASSO_SAMLP_STATUS(lasso_samlp_status_new());
    status_code = LASSO_SAMLP_STATUS_CODE(lasso_samlp_status_code_new());
    status_code->Value = g_strdup(LASSO_SAML_STATUS_CODE_REQUEST_DENIED);
    status->StatusCode = status_code;
    LASSO_SAMLP_RESPONSE(response)->Status = status;

    return LASSO_NODE(response);
}