Greg
Greg

Reputation: 442

Firebase storage throws authentication error on Android Things

Since Android Things SDK does not support Firebase Authentication, when connecting to Firebase Storage, I receive the error:

W/NetworkRequest: no auth token for request

E/StorageUtil: error getting token java.util.concurrent.ExecutionException: com.google.android.gms.internal.zzbqn: Please sign in before trying to get a token.

This error is repeated several times (several seconds) then eventually uploads. Any suggestion on how to anonymously upload to Firebase Storage without the Firebase Authentication Package and without runtime errors?

Upvotes: 1

Views: 1240

Answers (2)

chmoder
chmoder

Reputation: 986

I used custom tokens in my recent project.

In my case the process is as follows

  1. send the UID over bluetooth
  2. Create custom token with the UID
  3. Sign in with the custom token

Upvotes: 0

frapontillo
frapontillo

Reputation: 10679

The only way I think this may be achieved is by looking at:

  • how the Web API for Authentication performs authentication, then make your own REST calls from your app to retrieve access token (please be aware you also need to refresh the token when it expires)
  • how the Web API for Storage performs requests on the network, so you can mimic the behaviour, which will have to be reimplemented with some REST library

Have a read here to know what you can actually do with and without Play Services.

Upvotes: 1

Related Questions