I am building an enterprise application using Microsoft Graph to login. After a successful subscription, I want to use the token that will be sent for authentication in Firebase Auth (so that I can protect access to the database).
The token received after a successful login cannot be used directly in Firebase.
The Firebase user instructions page says:
Get the keys to your project:
- Go to the Service Accounts page in your project settings.
- Click Create a New Private Key at the bottom of the Firebase Admin SDK section on the Service Accounts page.
- A new pair of public and private keys of the service account is automatically saved on your computer. Copy this file to your authentication server.
The third paragraph says that you need to enter the key to the authentication server. Is this possible with Microsoft Graph or Azure AD ?
The key that Firebase gives you is the file JSON
. I checked the Microsoft application registration portal, which allows you to edit the application manifest, but to no avail.
The file is JSON
as follows:
{
"type": "service_account",
"project_id": "APP_ID",
"private_key_id": "KEY_ID_VALUE",
"private_key": "-----BEGIN PRIVATE KEY----<KEY VALUE>-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-0ubvc@********.iam.gserviceaccount.com",
"client_id": "XXXXXXXXXXXX",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-0ubvc%XXXXXXXX.iam.gserviceaccount.com"
}
I can't seem to find any github projects or stackoverflow threads that cover this issue.
How to get custom tokens using MS Graph or Azure AD?