Auth+Ticket+Ticket Validation Example?
See original GitHub issueEDIT
Skip to bottom – in between is progression.
Original Issue
I could only find Auth.GetAuthSessionTicket
that returns a byte[]
via _ticket.data
:
What do I do from there? In Steamworks.net, it’s stupidly complicated to convert it, then you need to send it away for a callback:
ticketBlob = new byte[1024];
// Retrieve ticket; hTicket should be a field in the class so you can use it to cancel the ticket later
// When you pass an object, the object can be modified by the callee. This function modifies the byte array you've passed to it.
hTicket = SteamUser.GetAuthSessionTicket(ticketBlob, ticketBlob.Length, out ticketSize);
// Resize the buffer to actual length
Array.Resize(ref ticketBlob, (int)ticketSize);
// Convert bytes to string
StringBuilder sb = new StringBuilder();
foreach (byte b in ticketBlob)
{
sb.AppendFormat("{0:x2}", b);
}
hexTicket = sb.ToString(); // Final result: Then you send it off to Steam to get verified. Send this hexTicket to your BaaS or oAuth2.
// Wait for OnGetAuthSessionTicketResponse to confirm the ticket is valid =>
private void OnGetAuthSessionTicketResponse(GetAuthSessionTicketResponse_t callback)
{
// Confirm validity of ticket here
}
How do I do the Facepunch equiv of this? Rather:
- How do you convert an
Auth.Ticket
to string (the final form)? - How do I validate the ticket (
OnGetAuthSessionTicketResponse()
equiv.)?
There used to be an example link via this issue ( https://github.com/Facepunch/Facepunch.Steamworks/issues/52 ). However, it’s now 404.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Kofax Supplier Portal API Guide
This service is used to authenticate a Supplier Portal user against the Supplier Portal endpoint, using a username and password as authentication credentials....
Read more >ReadSoft Supplier Portal API Guide
This service is used to authenticate a Supplier Portal user against the Supplier Portal endpoint, using a username and password as authentication credentials....
Read more >cdp.dll - powered by Falcon Sandbox
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to fight malware.
Read more >Bio Smart Kerberos
Authentication Server ( El Servidor de Autentificación KAS). ... especificado por el predicado SuccValid( C, Ticket, Auth), Ticket: TICKET y Auth: AUTH, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you want to verify the session ticket in a single player experience you’d need to post it to the
AuthenticateUserTicket
web-api of steamworks, notServer.Instance
The other method would be having a dedicated server that initializes a Server instance example:
var server = new Facepunch.Steamworks.Server(252490, options);
(see the Facepunch.Test assembly for a big example)After which you can use the
StartSession
part on the server, and send a callback to the client if it was correct or not.I haven’t played around with it yet but,
seems correct, should just post it to the webapi (see the Steam WebAPI doc for more info )
You can also See this Test-code to see it’s working only difference is you’re testing it locally instead of sending over the binary to the server who then checks it.
Alas, it seems that 50%+ of the time, users are getting an "Invalid Ticket:
{ \"response\" : { \"error\" : { \"errorcode\" : 101 , \"errordesc\" : \"Invalid ticket\"}}}
Anyone know what would cause this?
Related: https://github.com/Facepunch/Facepunch.Steamworks/issues/217