question

brendan avatar image
brendan asked

How to get a Steam AuthSessionTicket in Unity3d using Steamworks.net

zacb
started a topic on Wed, 03 June 2015 at 2:21 PM

Using Unity3d, how do I get a steam ticket to use with LoginWithSteam (https://api.playfab.com/Documentation/Client/method/LoginWithSteam)?

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

Best Answer
zacb said on Wed, 03 June 2015 at 2:33 PM

You must:

Call GetAuthSessionTicket, which will give you two things: 1) a byte array for the ticket and 2) a uint identifying the actual ticket length
Truncate the byte array to match the specified length
Convert the byte array to a hexadecimal string
Pass that string as the SteamTicket parameter in the LoginWithSteam API call

Note: The attached code sample requires Unity3d & Steamworks.net wrapper. To quickly get up and running with steamworks.net check out their example project.


1 Comment
zacb said on Wed, 03 June 2015 at 2:33 PM

You must:

Call GetAuthSessionTicket, which will give you two things: 1) a byte array for the ticket and 2) a uint identifying the actual ticket length
Truncate the byte array to match the specified length
Convert the byte array to a hexadecimal string
Pass that string as the SteamTicket parameter in the LoginWithSteam API call

Note: The attached code sample requires Unity3d & Steamworks.net wrapper. To quickly get up and running with steamworks.net check out their example project.

4 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.

Dylan Hunt avatar image Dylan Hunt commented ·

"Note: The attached code sample requires Unity3d & Steamworks.net wrapper."
Which attached code sample :P so far I'm looking at:
https://github.com/rlabrecque/Steamworks.NET-Test/blob/master/Assets/Scripts/SteamUserTest.cs

And not sure if you had a link to a simpler version

0 Likes 0 ·
brendan avatar image brendan Dylan Hunt commented ·

Thanks, I believe that's the same sample. When we converted from our previous forum system, we lost the attachments, apparently. If anyone encounters any other posts that are missing attachments (there were only a few, I believe), feel free to let us know.

1 Like 1 ·
Dylan Hunt avatar image Dylan Hunt brendan commented ·

Ah, thanks -- so it seems that I'm getting a 3 digit response, is that right? If not, is it possible to repost the examples? Do I need to actually call BeginAuthSession() or an auth session ticket is good enough (and playfab handles the rest)?

EDIT: Carried on here >> https://community.playfab.com/questions/8858/is-there-an-example-to-connect-playfab-to-steam-vi.html

0 Likes 0 ·
Show more comments
philippe.dasilva avatar image
philippe.dasilva answered

Hey, I was actually wondering about LoginWithSteam but couldn't make it. I really don't know what I'm doing wrong...

Do you actually need a "none Space Wars" Steamworks AppID to get it working?

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

Yes, the Steam login is a secure authentication with their servers, so you do have to create a title in Steam and set up your Publisher Key (https://partner.steamgames.com/documentation/webapi#publisherkey) in the Add-ons Marketplace to be able to use it. This login allows us to link to the player's profile in Steam on your behalf both for authentication and to enable in-app purchasing via StartPurchase/PayForPurchase/ConfirmPurchase.

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.