I am creating a RESTful API using the firebase admin SDK, entirely in Golang.
The problem occurs when attempting to integrate token-based authentication, which requires both client SDK and admin SDK
For example,
firebase client SDK provides methods such as
signInWithCustomToken
andsignInWithEmailAndPassword
which outputs ID tokens to be handled with methods in Admin SDK.firebase admin SDK provides methods such as
VerifyIDToken
to verify token passed from the client.
In the latest firebase documentation, it says,
The Firebase Admin SDKs bundle the Google Cloud client libraries for Cloud Firestore alongside client libraries and SDKs for several other Firebase features.
Since I needed to use both Client and Admin SDK with Golang, I have decided to use the Admin SDK.
However, Admin SDK documentation in Golang does not have methods such as signInWithCustomToken
and signInWithEmailAndPassword
.
If I were to build a RESTful API with Golang, do I have to use another front-end programming languages like JavaScript to achieve token-based authentication?
In JavaScript Admin SDK, they DO have methods available such as signInWithCustomToken
and signInWithEmailAndPassword
.
I would like to know the workaround to write token-based authentication when necessary methods are not documented with Golang in Admin SDK.