question

kawdraw avatar image
kawdraw asked

LoginWithSteam "Steam WebAPI error: 0 ()"

Hi, I have a HTML5 game build using Greenworks node addon, and I´m trying to log Playfab with the steam user ticket. Greenworks API already gives me the ticket in a hexadecimal string format, and have the "Steam Application ID" and "Steam Encrypted App Ticket Key" already configured into my title Steam addon config... but I got this error:

{
 "code": 400,
 "status": "BadRequest",
 "error": "InvalidSteamTicket",
 "errorCode": 1010,
 "errorMessage": "Steam WebAPI error: 0 ()",
 "CallBackTimeMS": 1142
}

I will really appreciate any light about this... thank you in advance!

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

I take it this is for Title ID 978B? The issue is that the Steam Application ID needs to be specified in hexadecimal format, currently. We'll be changing that to take the ID in decimal form soon, as that's the format used by the Steamworks site. I've updated your Steam page with the hex version of your App ID. Also, the "Encrypted App Ticket Key" should actually be the "WebAPI Key" - my apologies for the confusion on that, we'll have the site updated soon with the correct text.

14 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

kawdraw avatar image kawdraw commented ·

I´ve changed App id to hex format and I've set the "WebAPI Key" instead "Encrypted App Ticket Key"... it works perfectly!

Thank you very much for your time.

0 Likes 0 ·
Kain avatar image Kain commented ·

Hi, might there be any other causes for this error as of Sept 2017? I have the Steam app ID in decimal and the WebAPI key as described above, but I am still getting this exact error.

In Unreal C++, I use this method to extract the hexstring representing Steam's auth session ticket:

IOnlineIdentityPtr IdentityInt = Online::GetIdentityInterface(pWorld);
if (IdentityInt.IsValid())
{
	FString authToken = IdentityInt->GetAuthToken(0);

GetAuthToken calls this within it:

SteamUserPtr->GetAuthSessionTicket
0 Likes 0 ·
brendan avatar image brendan Kain commented ·

What's the Title ID for the game? Also, where specifically are you getting the Web API key from in Steamworks?

0 Likes 0 ·
Kain avatar image Kain brendan commented ·

The TestGame I am testing with has title ID 7153.

I got the Steamworks Web API key by registering for it here while ogged into our Steamworks account:

https://steamcommunity.com/dev/apikey

0 Likes 0 ·
Show more comments
carl avatar image carl commented ·

@Brendan Using Postman to exercise LoginWithSteam where I get the "SteamTicket" value from GetAuthToken(0) with code Kain posted above I get InvalideSteamTicket. I just today set up the steam plugin. Is there a latency to activation or some cache I need to clear?

{ "code": 400, "status": "BadRequest", "error": "InvalidSteamTicket", "errorCode": 1010, "errorMessage": "Steam WebAPI error: 0 ()" }

Thanks,

Carl

0 Likes 0 ·
brendan avatar image brendan carl commented ·

Nope, no latency. If that's the response you're getting, Steam is telling us the SteamTicket is bad. What is the Title ID, and where did you get the Web API Key from in Steam that you put in the configuration?

0 Likes 0 ·
carl avatar image carl brendan commented ·

The titleid is 5EA1 we got the Web API Key from the steam url with the pattern (I do not have admin privileges on steam and so was looking over the shoulder): https://partner.steamgames.com/pub/group/NNNN/MMMM . The Web API Key is in hex, the application id is in decimal, I tried hex but the interface complained. The SteamTicket is a long hex string of 480 characters.

0 Likes 0 ·
Show more comments
Show more comments
artemfeoktistov avatar image
artemfeoktistov answered

Hi @Brendan!

I struggle with same problem too. But it seems that is a different case.

LoginWithSteam API in Unity always returns error InvalidSteamTicket.

But when I use ticket directly by steam API, it returns proper response.

I get ticket from Steamworks .NET and use request like this:

https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1/?key=0A05DCACF25******DE7BC266150BD29&appid=******&ticket=14000000667af03f4a4a2cab1258e110010010014ebc375b1800000001000000020000005d1d6c5b6700a8c049ad7d023b000000b200000032000000040000001258e11001001001e89c0c005d1d6c5b6800a8c00000000054f3355bd4a2515b010060e0030000000000029250cbd302d2bef7****ed90e9a3690de6dea7ef5526bbf698ca9afb3284d0b4d5a9cc75b2400e2403f557c0a6479e165eb41c9b696fab88ca22dc88fdba9c9bb8fce723cdce1f1cc9e9e4fde5c5cabffe1fbcd316cc9c3b895cc00b7ec5a9b59ffbff7f4a745a51d1e8b7ffe100c99f79bfe786c1b3b3c352a9ba9187fbe1

And I get response:

{"response":{"params":{"result":"OK","steamid":"7656**98243469330","ownersteamid":"76561**8243469330","vacbanned":false,"publisherbanned":false}}}

But when I test it using https://api.playfab.com/documentation/client/method/LoginWithSteam it returns error :

{"code": 400,"status": "BadRequest","error": "InvalidSteamTicket","errorCode": 1010,"errorMessage": "Steam WebAPI error: 0 ()","CallBackTimeMS": 453}

Also testing it with Unity using tutorial steps https://api.playfab.com/docs/tutorials/landing-players/getstarted-steam-unity returns same error.

My Playfab title id is 7106. Steam add-on is properly installed.

Playfab SDK version: 2.42.180618 . Unity 2018.1.0f2

I would appreciate for any help!

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

What, specifically, are you passing into the login call? Can you confirm that you're using this method to set the ticket you're passing in? https://community.playfab.com/questions/240/205846468-How-do-I-convert-the-Steam-Session-Ticket-for-sign-in-with-PlayFab-.html

0 Likes 0 ·
kranchy avatar image
kranchy answered

Hi, I followed the tutorial steps (https://api.playfab.com/docs/tutorials/landing-players/getstarted-steam-unity) and I get the same error : Steam Web API Error: 0 ()

Since they are no information on the error I guess I pass the wrong ticket format, but I tried many differents hex converting functions and I still get the error. Did the format change recently ?

Here is the code I'm using :

        var request = new LoginWithSteamRequest
        {
            CreateAccount = true,
            SteamTicket = GetSteamAuthTicket(),
            TitleId = PlayFabSettings.TitleId
        };


        //Authenticate on Playfab
        PlayFabClientAPI.LoginWithSteam(request, OnComplete, OnFailed);



    public string GetSteamAuthTicket()
    {
        var pTicket = new byte[1024];
        uint pcbTicket;
        SteamUser.GetAuthSessionTicket(pTicket, 1024, out pcbTicket);
        var hexEncodedTicket = "";
        for (int i = 0; i < pcbTicket; i++)
            hexEncodedTicket += $"{pTicket[i]:X2}";
        return hexEncodedTicket;
    }



I came back to the formatting method I used for GameSparks three months ago and which worked. I also use the Playfab Editor Extentions for Unity and I set up the Playfab Steam Addon for my game Cellyon - Boss Confrontation 147C

Do you have an idea for what is causing this issue ?

Thanks in advance

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

No, there haven't been any changes to the LoginWithSteam path for a very long time, now. More to the point, we have a hard-core rule against any breaking changes, so we would not make a change that altered the behavior, since it would break every existing title.

Can you setting a breakpoint and confirm that your resultant hexEncodedTicket is a match (as a string) for the ticket you're getting back?

If it is, can you try adding me to your title in Steamworks, so that I can have a look at the Web API key setup?

0 Likes 0 ·
kranchy avatar image kranchy brendan commented ·

Hi, thank you for the answer ! You were right, I was using the wrong WebAPI key and coincidently I found the right one when trying to add you to Steamworks.

With the key from Manage Groups it is corretly working. Sorry for bothering, I saw you already commented the solution but I didn't understand it the first time. Anyway thanks for taking the time to reply, maybe you could insist on this in the tutorial, since I thought I already set up my Steamworks correctly I completely missed the prequisites links.

Have a nice day

0 Likes 0 ·
brendan avatar image brendan kranchy commented ·

No worries - glad to hear you've got it working!

0 Likes 0 ·
cbr-developer avatar image
cbr-developer answered

Hello, can you help me with function LoginWithSteamRequest:

<color=red>[PF] **ERR registering player with Steam: /Client/LoginWithSteam PlayFabError(InvalidSteamTicket, Steam WebAPI error: 0 (), 400 BadRequest)</color> UnityEngine.Debug:Log(Object) CarBattleRoyale.<LoginWithSteam>c__AnonStorey2:<>m__1(PlayFabError) (at Assets/Scripts/Gameplay/PlayFab/PlayFabManager.cs:119) PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:251) PlayFab.Internal.<Post>c__Iterator1:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:180) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

12 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

What is your Title ID?

0 Likes 0 ·
cbr-developer avatar image cbr-developer brendan commented ·

Hi, @Brendan, 7A5

0 Likes 0 ·
brendan avatar image brendan cbr-developer commented ·

Well, the Steam settings look correct. Can you share the code snippet showing how you're converting the Steam ticket to a string to pass into the call to LoginWithSteam?

0 Likes 0 ·
Show more comments
cbr-developer avatar image cbr-developer commented ·

@Brendan, thanks for help, I solved a problem

0 Likes 0 ·
brendan avatar image brendan cbr-developer commented ·

For the sake of others who run into a similar situation in future, what did this turn out to be, in your case?

0 Likes 0 ·
cbr-developer avatar image cbr-developer brendan commented ·

@Brendan Problem was fixed when I updated Web Api key on project page in Steam. Thanks again for help and fast answers.

0 Likes 0 ·
Show more comments
ejr avatar image
ejr answered

I got also error 0.
AppID: B984A

Steam ID: 486880

In other app (660E) everything works ok, but got error 0 everytime when I switch to this app.

What may be wrong? Steam Web API Key is exactly the same in both apps.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ejr avatar image ejr commented ·

I've managed to fix that. It was problem with... Unity, not Steam. Unity editor needs to be restarted when you try to use antother Steam app.

When using a steam_appid.txt with Steam ID in it, Unity will always use the ID that it has read on the start. So changing it, changing scripts, changing literally anything will not work before restarting Unity Editor.
Sorry for bothering.

0 Likes 0 ·
Good Guy avatar image
Good Guy answered

Adding my variation here:
I sometimes get "InvalidSteamTicket" errorcode 100

The solution is to restart the Steam client.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.