I'm building an enterprise app using Microsoft Graph to sign in. After a successful signing i want to use the token to be sent to authenticate to Firebase Auth (so i can secure the access to the database).
The token recieved after a successful sign in cannot be used directly to Firebase.
On the Firebase custom Auth instructions page it says:
Get your project's server keys:
- Go to the Service Accounts page in your project's settings.
- Click Generate New Private Key at the bottom of the Firebase Admin SDK section of the Service Accounts page.
- The new service account's public/private key pair is automatically saved on your computer. Copy this file to your authentication server.
The third point says that you need to enter the key to the authentication server. Is this possible using Microsoft Graph or Azure AD?
The key that Firebase gives you is a JSON
file. I've checked Microsoft App registration portal which allows you to edit the apps Manifest, but with no luck.
The JSON
file looks like this:
{
"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 covers this issue.
How can you recieve custom tokens with MS Graph or Azure AD?