Skip to content

Declared in <galanthus/c_api/gln_capi.h>.

GLN_API gln_status_t GLN_CALL gln_revolut_oauth_authorize_url(
    gln_backend_t* in_backend,
    const char*    in_state,
    char**         out_authorize_url,
    gln_error_t*   out_error);
  • Family: Revolut OAuth setup
  • Return type: gln_status_t

Purpose

Builds the Revolut Business OAuth authorization URL for an opened Revolut backend.

The returned URL includes the caller-supplied state and is suitable for handing to the host application's browser or redirect flow.

Return

Returns GLN_OK on success and a non-OK gln_status_t value on failure.

TypeNullabilityOwnership
gln_status_tvaluevalue

Parameters

NameDirectionTypeNullabilityOwnership
in_backendinputgln_backend_t*nonnullborrowed
in_stateinputconst char*nonnullborrowed
out_authorize_urloutputchar**nonnulltransferred_out
out_erroroutputgln_error_t*nullablecaller_allocated_output

Behavior

This call does not contact Revolut and does not read or write token storage.

in_backend must be a Revolut backend opened with gln_open_revolut_backend; passing another backend family returns GLN_ERR_NOT_SUPPORTED.

in_state must be a non-empty caller-generated correlation value. The library copies it into the generated URL but does not retain it.

Ownership

On success, out_authorize_url receives a caller-owned string. Release it with gln_release_string.

The function clears *out_authorize_url to NULL before validation when the output slot itself is non-NULL.

Example

char* authorize_url = NULL;
gln_error_t error = {0};
gln_default_error(&error);
gln_status_t rc = gln_revolut_oauth_authorize_url(
    backend,
    "caller-generated-oauth-state",
    &authorize_url,
    &error);
if (rc == GLN_OK) {
    open_authorization_page(authorize_url);
}

gln_release_string(authorize_url);
gln_release_error(&error);

See Also