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:
Listen to all the signals you are interested in.
Connect to the server using the connect_to_server() method.
Then you can request login info using the request_login_info() method.
Open the resulting login url received after awaiting on the LoginURLResponse.finished signal.
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
|
||
|
||
|
||
|
||
|
||
|
Methods
void |
|
request_auth(login_type: String, auth_id: String, code: String) |
|
request_auth_id(login_type: String) |
|
request_login_info(login_type: String) |
|
request_steam_auth(auth_id: String, steam_ticket: String) |
|
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 get_connected()
Client connected state.
String discord_embedded_app/path = "blazium/login" 🔗
Set to what path this client should use when connecting to the discord embedded app.
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://" 🔗
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" 🔗
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://" 🔗
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.