LoginClient

Inherits: BlaziumClient < Node < Object

Node for connecting to the Blazium Login service. Offers authentication mechanism.

Description

The LoginClient node provides an interface for connecting to the Blazium Login service. There is a free instance hosted on the blazium.app domain that is used by default.

The authentication flow is as follows:

  1. Listen to all the signals you are interested in.

  2. Connect to the server using the connect_to_server() method.

  3. Then you can request login info using the request_login_info() method.

  4. Open the resulting login url received after awaiting on the LoginURLResponse.finished signal.

  5. Obtain the jwt from the received_jwt signal.

Note: Some methods are non blocking and can be awaited in order to get the result.

Properties

bool

connected

false

String

discord_embedded_app/path

"blazium/login"

String

game_id

""

String

http_prefix

"https://"

String

server_url

"login.blazium.app"

String

websocket_prefix

"wss://"

Methods

LoginConnectResponse

connect_to_server()

void

disconnect_from_server()

LoginAuthResponse

request_auth(login_type: String, auth_id: String, code: String)

LoginIDResponse

request_auth_id(login_type: String)

LoginURLResponse

request_login_info(login_type: String)

LoginAuthResponse

request_steam_auth(auth_id: String, steam_ticket: String)

LoginVerifyTokenResponse

verify_jwt_token(jwt_token: String)


Signals

connected_to_server() 🔗

Signal emitted when the client connects to the server.


disconnected_from_server(reason: String) 🔗

Signal emitted when the client disconnects from the server.


log_updated(command: String, logs: String) 🔗

Signals a log from a command.


received_jwt(jwt: String, type: String, access_token: String) 🔗

Signal emitted when a JWT is received.


Property Descriptions

bool connected = false 🔗

  • bool get_connected()

Client connected state.


String discord_embedded_app/path = "blazium/login" 🔗

  • void set_override_discord_path(value: String)

  • String get_override_discord_path()

Set to what path this client should use when connecting to the discord embedded app.


String game_id = "" 🔗

Set what game id this client should use when connecting to the server. If this is missing connection will error.

Can only contain alphanumeric characters.


String http_prefix = "https://" 🔗

  • void set_http_prefix(value: String)

  • String get_http_prefix()

The http prefix that will be added to the url. If you want to use http instead of https, set it there.


String server_url = "login.blazium.app" 🔗

  • void set_server_url(value: String)

  • String get_server_url()

Set to what url this client should connect to.

For discord embedded app environment, replaces the url with client_id.discordsays.com/.proxy/blazium/login/connect if left default, where client_id is the client id from the discord embedded app url (automatically detected).


String websocket_prefix = "wss://" 🔗

  • void set_websocket_prefix(value: String)

  • String get_websocket_prefix()

The http prefix that will be added to the url. If you want to use ws instead of wss, set it there.


Method Descriptions

LoginConnectResponse connect_to_server() 🔗

Connects to the server specified in server_url using the game id specified in game_id. Must be done before requesting login info.

Generates connected_to_server when connected.

Returns a LoginConnectResponse object that has a LoginConnectResponse.finished signal that is emitted when finished.


void disconnect_from_server() 🔗

Disconnect from the server.

Needs connect_to_server() to be called first.

Generates disconnected_from_server when disconnected.


LoginAuthResponse request_auth(login_type: String, auth_id: String, code: String) 🔗

Request login auth jwt using the login type specified, auth_id and access code.

Needs connect_to_server() to be called first.

Returns a LoginAuthResponse object that has a LoginAuthResponse.finished signal that is emitted when finished.

Generates received_jwt when a jwt is received.


LoginIDResponse request_auth_id(login_type: String) 🔗

Request login auth id using the login type specified.

Needs connect_to_server() to be called first.

Returns a LoginIDResponse object that has a LoginIDResponse.finished signal that is emitted when finished.


LoginURLResponse request_login_info(login_type: String) 🔗

Request login info using the login type specified.

Needs connect_to_server() to be called first.

Returns a LoginURLResponse object that has a LoginURLResponse.finished signal that is emitted when finished.


LoginAuthResponse request_steam_auth(auth_id: String, steam_ticket: String) 🔗

Request login auth jwt using the auth_id and steam_ticket.

Needs connect_to_server() to be called first.

Returns a LoginAuthResponse object that has a LoginAuthResponse.finished signal that is emitted when finished.

Generates received_jwt when a jwt is received.


LoginVerifyTokenResponse verify_jwt_token(jwt_token: String) 🔗

Verify the jwt token is still valid.

Needs connect_to_server() to be called first.

Returns a LoginVerifyTokenResponse object that has a LoginVerifyTokenResponse.finished signal that is emitted when finished.