Skip to content
Back

Steam Authentication (Not OAuth)

  • 0
  • Auth
coffeebean
1 Aug, 2024, 15:06

I have an electron application that authenticates through Steamworks with Steamworks.js. I want to pass this authentication to Appwrite somehow.

My thought was to use the Steam session token and pass it to Appwrite as a JWT token

TypeScript

appwrite.account.createJWT({ authTicket })

and then also double check the authentication via the steam API for extra security

TypeScript
const { data } = await axios.get('https://partner.steam-api.com/ISteamUserAuth/AuthenticateUserTicket/v1', {
    params: {
        appid: parseInt(process.env.STEAM_APP_ID ?? '0'),
        key: process.env.STEAM_WEBAPI_KEY,
        ticket,
    },
});

if (!(data?.response?.params?.steamid ?? '').length) {
    throw new Error('no steamid found');
}

Would something like this work? If not, is there a way I can authenticate someone with the steam session token or steam user ID?

TL;DR
Developers want to authenticate users through Steam in an Electron application and then pass that authentication to Appwrite. They are considering using a Steam session token as a JWT token in Appwrite and double-checking the authentication through the Steam API for extra security. They shared code snippets for both processes. Suggested solution: The proposed approach should work, with the Steam session token passed to Appwrite as a JWT token and the authentication double-checked via the Steam API for enhanced security. No obvious issues arise from the provided code snippets.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more