forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth.ps1
executable file
·39 lines (30 loc) · 1009 Bytes
/
auth.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env pwsh
# Old version
<#
# Constants
$loginToken = "kSiBszXoB5hOQBAMBC//f2YcxD76Ec36rlKy+f8sjhY="
$authServer = "http://localhost:5000/"
$localServer = "http://localhost:1212/"
$userName = "PJB"
$authUrl = $authServer + "api/session/getToken"
$localUrl = $localServer + "info"
$pubKey = Invoke-WebRequest $localUrl |
select -exp Content |
ConvertFrom-Json |
select -exp auth |
select -exp public_key
$postData = @{"ServerPublicKey"=$pubkey} | ConvertTo-Json
$token = Invoke-WebRequest $authUrl `
-Method Post -Body $postData `
-Headers @{"Authorization"="SS14Auth $loginToken"} `
-ContentType "application/json" |
select -exp Content
echo $token
bin/Content.Client/Content.Client --launcher --username $userName `
--cvar "auth.token=$token" `
--cvar "auth.serverpubkey=$pubKey"
#>
$loginToken = "kSiBszXoB5hOQBAMBC//f2YcxD76Ec36rlKy+f8sjhY="
$authServer = "http://localhost:5000/"
$userName = "PJB"
$userId = "957ebebb-1a06-4a6e-b8ae-f76d98d01adf"