question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NOTAUTHENTICATED - Expired/Invalid Steam Ticket: authTicket.Cancel() is not cancelling as it's supposed to

See original GitHub issue

There’s no cancel last ticket function like found in Steamworks.net (which seemed to work fine with this) – however, if you request a new Auth.Ticket, it will always give you the last [same] one so you can cancel it. The next time you get a ticket, it will give you a different one.

However, our users are constantly getting timeouts due to invalid tickets. It seems that the tickets are not cancelling as they should:

What is the proper way to get a new auth ticket while cancelling the old one? This does not work:

function Auth.Ticket getTicket()
{
  // Get last ticket and cancel
  Auth.Ticket oldTicket = s_client.Auth.GetAuthSessionTicket();
  oldTicket.Cancel();

  // Get a new ticket
  Auth.Ticket newTicket = s_client.Auth.GetAuthSessionTicket(); 
  return newTicket;
}

Users are getting expired/invalid ticket responses (NOTAUTHENTICATED): The only way to get a real ticket is to try again a few times – I’m not sure if it’s a time or number of tries. Probably time:

Do I need to yield a period of time after cancelling a ticket before getting a new one? What is the proper method for this?

We cancel tickets @ onDestroy as directed in the demo, but that doesn’t seem to be good enough. We also tried to cancel them directly before getting a new one - that doesn’t seem to work, either.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
dylanh724commented, Nov 17, 2018

As an update, it seems that yielding 0.5 seconds after cancelling the ticket (before getting a new one) seems to do the trick. I could probably lower that timer.

While I’m still testing this, if this continues to work, would that mean that there is an unimplemented callback to the Auth.Ticket.Cancel() func that we’d normally have to wait on before continuing?

EDIT 1

https://partner.steamgames.com/doc/features/auth

It seems that there should actually be a callback to ensure a valid auth ticket session – this was available in sw.net, but can’t seem to find it in fp.sw

0reactions
OndrishDcommented, Mar 7, 2019

This is literally facepunch issue 😃. This method is handled with callback on steam Api. The reason is obvious as steam client has to first communicate the ticket with steam servers so you can use it for authentication with 3rd party server in next step. This takes time, can fail, etc.

The current implementation here is not using this callback and immediately returning unconfirmed byte array.

@MichalPetryka your solution is almost right, except you just stalled the thread from which the method call is made. This is very bad and should not be solved this way.

The method should be reworked to something like public void GetAuthSessionTicket(Action<Ticket> callback)

And status of operation should be included in ticket so developer can react on failed attempts. (The result status is returned in Steam callback GetAuthSessionTicketResponse_t)

The solution with delayed call might work in some cases but I would not recommend go with such fix in any serious release that require this functionality to work properly and reliable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Steam Auth Ticket has been Cancelled? :: Team Fortress 2 ...
It does NOT mean that you're banned, though, so don't worry about that. Restarting Steam should fix it, but if you want to...
Read more >
My Steam Support ticket was closed and I don't know why
Tickets will not automatically close if they're waiting to be addressed by a Steam Support agent.
Read more >
What to do if your flight is canceled or delayed
The US Department of Transportation says you are entitled to a refund of your ticket cost because of a cancellation or “significant delay”...
Read more >
Cancel or pause your YouTube TV membership - Android
When you cancel or pause your membership, you'll still have access to YouTube TV until the end of your payment period. Canceling YouTube...
Read more >
Need to cancel a flight? What to know about 24-hour ...
Travelers can get a free refund on most airline tickets if they cancel their reservation within 24 hours of booking.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found