skip to Main Content

I currently have a web project for a game and I want users to be able to login to share stuff, that is currently done (and neatly working) using google’s firebase authentication.

But I want people to be able to be authenticated via Steam (using Oauth2)

the firebase reference/API (https://firebase.google.com/docs/auth/web/custom-auth) wasn’t to helpful as I couldn’t find exact (working) examples of what I need to implement and I don’t have too much experience with Oauth2 or Firebase yet.

from http://steamcommunity.com/dev I got my API key and that I should use “http://steamcommunity.com/openid” as the provider.

And I tried using it this way:

var provider = new firebase.auth.OAuthProvider("steamcommunity.com/openid");

firebase.auth().signInWithPopup(provider).catch(function(error)
{
  console.log(error.message);
});

this is the basic function that works with all the default providers (Google, Twitter, Facebook, etc)

However I get a “provider ID not supported” in the console, and I have obviously forgotten something somewhere, but I don’t really know what it is exactly (I know I should be inputting the API secret from steam somewhere) and I am not sure for where to start looking (eg. do I need to change anything in my firebase settings, ..)

It would be really helpful if someone could help me out with my problem or point to a working example that I can go through, as my googling has only led me to the official firebase references and API and those haven’t really helped me so far.

2

Answers


  1. firebase.auth.OAuthProvider currently only supports existing providers and has not been extended to support additional providers.
    You would need to use custom authentication. I just googled and found this library for authentication with Steam: https://www.npmjs.com/package/steam-login. You can use that to sign in with Steam and then get the Steam user ID, mint a custom token with it using Firebase Admin SDK: https://firebase.google.com/docs/auth/admin/create-custom-tokens using that Steam UID and then send the custom token to the client to complete sign in with signInWithCustomToken: https://firebase.google.com/docs/auth/web/custom-auth

    Login or Signup to reply.
  2. You can do that with Identity Platform provided by GCP. You can find the documentation in the following link. You need to have a billing enabled Firebase project to do so.

    https://cloud.google.com/identity-platform/docs/web/oidc

    First you have to configure the new OpenID Connect provider in GCP console. Then you can simply use Firebase OAuthProvider as you usually use with other Firebase provided OAuth services.

    I will not going to explain every step here because the documentation has everything you need to know.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search