Skip to content

rc_client_begin_login_with_password

Jamiras edited this page Oct 8, 2023 · 4 revisions

Starts the login process for a user.

Syntax

rc_client_async_handle_t* rc_client_begin_login_with_password(
    rc_client_t* client,
    const char* username,
    const char* password,
    rc_client_callback_t callback,
    void* callback_userdata
);

Parameters

client

The rc_client_t to manage the logged in user.

username

The user's login.

password

The user's password.

callback

Function to call when the login process completes.

callback_userdata

Additional information to pass to the callback function.

Returns

Pointer to an rc_client_async_handle_t that can be passed to rc_client_abort_async to cancel the login request. The rc_client_async_handle_t is invalid after callback has been called.


rc_client_callback_t

void (*rc_client_callback_t)(
    int result,
    const char* error_message,
    rc_client_t* client
);

result

RC_OK on success, or an error code indicating the failure.

result problem
RC_OK User was successfully logged in.
RC_INVALID_CREDENTIALS The provided credentials were not recognized.
RC_EXPIRED_TOKEN The provided token has expired. The user should re-enter their credentials to generate a new token.
RC_ACCESS_DENIED Valid credentials were provided, but the user has not registered their email or has been banned.
RC_INVALID_STATE Generic failure. See error_message for details.
RC_INVALID_JSON Server response could not be processed.
RC_MISSING_VALUE Server response was not complete.
RC_API_FAILURE Error occurred on the server. See error_message for details.

error_message

NULL on success, or a message related to a non-successful result.

client

The rc_client_t that was handling the login attempt.

Remarks

If successful, rc_client_get_user_info will return information about the logged in user, including a token that can be stored and passed to rc_client_begin_login_with_token in future sessions.

Minimum version: 11.0.0

See also

rc_client_begin_login_with_token

rc_client_create

rc_client_get_user_info

rcheevos
rc_client

Integration guide

client

user

game

processing

additional data

rc_client_raintegration

Integration guide

rc_runtime
rhash
rapi

common

user

runtime

info

Clone this wiki locally