question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datatbase secretes have been depreciated

See original GitHub issue

Datatbase secretes have been depreciated do you have a way of doing this using Firebase Admin sdk?

image

var auth = "ABCDE"; // your app secret
var firebaseClient = new FirebaseClient(
  "<URL>",
  new FirebaseOptions
  {
    AuthTokenAsyncFactory = () => Task.FromResult(auth) 
  });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

5reactions
JasperTackcommented, Oct 6, 2020

The sample code from wikes82 worked for me when I added the second scope:

// Define the required scopes.
var scopes = [
  "https://www.googleapis.com/auth/userinfo.email",
  "https://www.googleapis.com/auth/firebase.database"
];

As described here: https://firebase.google.com/docs/database/rest/auth

4reactions
wikes82commented, Jul 22, 2020

for anyone needing sample code to use service account file var firebaseClient = new FirebaseClient(FirebaseUrl, new FirebaseOptions { AuthTokenAsyncFactory = () => GetAccessToken(), AsAccessToken = true });

GetAccessToken() is something like this : private async Task<string> GetAccessToken() {
var credential = GoogleCredential.FromFile(pathToJsonFile).CreateScoped(new string[] { "https://www.googleapis.com/auth/firebase.database" });

ITokenAccess c = credential as ITokenAccess; return await c.GetAccessTokenForRequestAsync();

}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database secrets are currently deprecated and use a ...
Database secrets are currently deprecated and use a legacy Firebase token generator. Update your source code with the Firebase Admin SDK.
Read more >
[Solved]Database secrets are currently deprecated |Firebase ...
Solution to get the database and secretes from the Firebase ... js 8 deprecated firebase,crashlytics has been deprecated in favor of ...
Read more >
Firebase Database Secrets on Google Apps Script
As Database secrets are easier to use, far from really deprecated and safe enough for most use cases, that's what we will use...
Read more >
Using (deprecated) secret to access firebase realtime ...
I have a simple Firebase realtime database, just PUT/GET. It all works. But security is confusing to me.
Read more >
Restore an AWS Secrets Manager secret - AWS Documentation
Secrets Manager considers a secret scheduled for deletion deprecated and you can no longer directly access it. After the recovery window has passed,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found