Skip to content

GetAuthSessionTicket() produces invalid tickets #94

@henrydatei

Description

@henrydatei

I tried to validate a ticket produces by GetAuthSessionTicket(). But Steam says that the ticket is invalid. I used the following code and I'm using Ubuntu 22.04 LTS.

from steamworks import STEAMWORKS
st = STEAMWORKS()
st.initialize()
auth_token = st.Users.GetAuthSessionTicket()
player_id = st.Users.GetSteamID()
player_name = st.Friends.GetPlayerName().decode('utf-8')
friends = ",".join([str(st.Friends.GetFriendByIndex(i)) for i in range(st.Friends.GetFriendCount())])
print(auth_token)
print(player_id)
print(player_name)
print(friends)

params = {
    "key": "YOUR KEY", # see it on https://steamcommunity.com/dev/apikey
    "appid": "480",
    "ticket": auth_token
}
r = requests.get("https://api.steampowered.com/ISteamUserAuth/AuthenticateUserTicket/v1/", params=params)
print(r.json())

Steam returns

{'response': {'error': {'errorcode': 101, 'errordesc': 'Invalid ticket'}}}

I used the AppID 480 also in the file steam_appid.txt. Do I do something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions