0
votes

Background on my login flow:

I'm creating a C# WPF Application which will be distributed to an end-user.

On my Website, I'm using FirebaseUI Auth to do the login authentication so that the user can log in with Google, Facebook or Email.

When the user initiates a log into the Application, it transfers the user over to the Website temporarily which mints a custom JWT token on the server which is returned to the Website then -> Application and then Application then uses to the freshly minted JWT token to Authenticate with FirebaseAuthentication.net to generate a Firebase auth token. This works great for connecting to Firebase REST API's like Firestore to obtain user information on client Application.

The Problem: Not only do I want to connect to the Firebase API's, but to the Google Cloud Speech API as well (in this case Speech-To-Text). I don't believe the Firebase auth token is sufficient to achieve this. I can verify the user and access their Firebase data on the server or the client, yet this is insufficient to connect to the Google Speech-To-Text API. In Google's examples using the client credentials first requires obtaining an auth-code from their authorization endpoint. In Google's Windows Application OAuth Example This is the https://accounts.google.com/o/oauth2/v2/auth authorization endpoint. https://cloud.google.com/docs/authentication/

Theorizing creates another potential question which could sooner answer the question: Could I use my FirebaseUI Auth page as an OAuth Endpoint to somehow authenticate my End-User Application with Google to connect to the Google Speech-to-Text API instead of using the https://accounts.google.com/o/oauth2/v2/auth endpoint?

The Question: How do I access the Google Cloud Speech-To-Text API from an end-user Application after authenticating them with Firebase Auth?

Google's reference for how to authenticate as an end-user: https://cloud.google.com/docs/authentication/end-user

1

1 Answers

2
votes

Google Cloud Speech API auth needs to happen separately. You would need to enable this API from Cloud Console and create the service account key. Since this is an end user app I would recommend doing it on the server side. API integration examples are available in the Firebase GCP Integration Doc.