Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to handle Manual Sign In Flow via Firebase from a Unity Game Client that uses Epic Games Acc?

I'm trying to integrate Firebase to my Unity Game Client.

Here's my current plan:

1. Unity Game Client Launch

2. Player clicks on the "Login" Button

3. A browser opens and launches the EPIC Games Login Web Portal

4. The player keys in the account username and password.

5. The Web Portal proceeds to login the Player and closes the browser, sending the Epic Client ID Token back to the Unity Game Client

6. The Unity Game Client sends a REST API "Post" call to Firebase, passing in the Epic Client ID Token earlier, to Firebase.

7. Firebase takes the Epic Client ID Token and sends the Token to Epic Game's OpenID endpoint to verify if this is a legitimate user: https://api.epicgames.dev/epic/oauth/v2/.well-known/openid-configuration

8. Epic Games sends a response validating the Player back to Firebase.

9. Firebase logs in the Player using the Epic Games Account credentials OIDC 

10. Firebase sends a response back to the Unity Game Client with the Firebase Token.

So in summary:

The Unity Game Client will have 2x token (1x Firebase Token, 1x Epic Games Client ID Token) and can use them to access the relevant data.

Most Importantly, I'm NOT using the Unity Firebase SDK as that SDK is restricted to Android Platform. Since I want my games to be Platform Agnostic, I have to use REST API.

Looking through this:

I'm not sure if the above function can be implemented as a Cloud Function for my Unity Game Client to call? Because it seems to be describing what I need to do, send the EPIC ID Token to Firebase and have Firebase handle the verification to the EPIC Games OpenID endpoint.

OR 

Should I be using this:Method: accounts.signInWithIdp  |  Identity Platform Documentation  |  Google Cloud

SignInWithIDP, however it is not clear to me (at least) if the SignInWithIDP will actually check with EPIC if the Epic Client ID Token is valid? Can someone clarify this as well?

I do not have a backend server and would prefer to keep it simple, just Firebase as the backend. Does Firebase support what I'm trying to implement?

0 2 457
2 REPLIES 2

Hi @Ermelious 👋 Welcome to the Integration Services Community! Thank you for posting your question—I’ll keep an eye on this thread to help ensure it gets the attention it needs.

Glad to have you with us!

Hi Ermelious, 

Thanks for reaching out. This question is tagged with `Application Integration`, but it seems it's not related to this product. Kindly ask to use the correct tag for faster routing to relevant team(s).

Thanks! 

Top Solution Authors