Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
W
w4gd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
W4 Games
SDKs
w4gd
Merge requests
!41
You need to sign in or sign up before continuing.
feat(smauth): Add steam login
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
feat(smauth): Add steam login
implement_steam_login
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Gilles Roudière
requested to merge
implement_steam_login
into
main
7 months ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
version 2
version 2
30e0e010
7 months ago
version 1
28285a35
7 months ago
main (base)
and
latest version
latest version
1ed99617
1 commit,
7 months ago
version 2
30e0e010
1 commit,
7 months ago
version 1
28285a35
1 commit,
7 months ago
Show latest version
1 file
+
39
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
smauth/smauth.gd
+
39
−
1
Options
@@ -63,7 +63,45 @@ func login_device_auto():
cfg
.
save
(
file
)
return
login_device
(
cfg
.
get_value
(
section
,
"device_id"
),
cfg
.
get_value
(
section
,
"device_key"
))
## Login using a Steam auth token.
##
## This only work if steam login provider is enabled in the backend.
##
## [param identity] The identity used to generate the auth token. This can be
## any value that would identify your service/game.
##
## [param ticket] The hexadecimal-encoded binary of the authentication ticket returned
## by Steam's GetAuthTicketForWebApi SDK function.
## See https://partner.steamgames.com/doc/api/ISteamUser#GetAuthTicketForWebApi.
##
## Example usage with GodotSteam (https://godotsteam.com/).
## [codeblock]
## # Request a web API ticket.
## var identity = "my_godot_game"
## var ticket_id = Steam.getAuthTicketForWebApi(identity)
## assert(ticket_id != 0)
##
## # Get the ticket for the response.
## var res
## var res_ticket_id = 0
## while res_ticket_id != ticket_id:
## res = await Steam.get_ticket_for_web_api
## res_ticket_id = res[0]
## assert(res[1] == 1) # Check if request was successful (result = 1).
##
## var ticket_buffer = res[3]
##
## # Login using token.
## var response = await W4GD.auth.login_steam(identity, (ticket_buffer as PackedByteArray).hex_encode()).async()
## [/codeblock]
##
## Note: setting up GodotSteam requires more than this code snippet (some configuration
## and callbacks setup). Check out https://godotsteam.com/tutorials/initializing/ and
## https://godotsteam.com/tutorials/authentication/ for more information.
##
## Note: while GodotSteam is not a strict requirement for using this login method, a
## way to access the Steam SDK within Godot is required. Right now, GodotSteam is the
## easiest way to achieve this, so its usage is very recommanded.
func
login_steam
(
identity
:
String
,
ticket
:
String
):
return
begin_sso
(
"anon.localhost"
Loading