0

I'm building an iOS app, and i have a custom back end that i'm using for authentication and other stuff ( i'm not maintaining it, so i don't know much about it, except the swagger documentation for end points).

We have arrived at a point were we need to provide a way for our users to store some photos, and it has been decided that we should either user Google's Firebase or Amazon's bucket service.

I've decided to go with Google, cause i find the documentation easier to read for a beginner like me.

Now i'm thinking my bucket structure should look something like: Users -> user -> user's photo.

So i need to basically duplicate what users i have already in the custom back end, in firebase? I'm not sure how should i approach this, and any hints would be helpful.

Thanks.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
CodeGeass
  • 619
  • 2
  • 7
  • 20
  • Unable to understand **So i need to basically duplicate what users i have already in the custom back end, in firebase**. Please edit your question and explain more. – dahiya_boy May 14 '19 at 11:55
  • It is not crystal clear if you want to use your own authentication system OR if you want to use one of the Firebase authentication mechanism (e.g. by email) and import in Firebase all your existing users. – Renaud Tarnec May 14 '19 at 12:46
  • I want to use my own auth system like i have been doing. I want to save user's photo's with firebase, but from what i understand for the process to be secure i need to authenticate first with a firebase user, then post the photo. So my question is what should i do? Do i need to duplicate my users in firebase? Do i simply create new ones when he tries to save a photo, what exactly should be my design goal here? – CodeGeass May 14 '19 at 12:53

1 Answers1

2

If you want to use your own authentication system, with the Firebase Admin SDK you can "integrate an external user system with Firebase", see the doc here, which also says:

You may already have a pre-existing user database or you may want to integrate with a third-party identity provider that Firebase Authentication doesn’t natively support.

To do this, you can create custom tokens with arbitrary claims identifying the user. These custom tokens can then be used to sign into the Firebase Authentication service on a client application and assume the identity described by the token's claims. This identity will then be used when accessing other Firebase services, such as Cloud Storage.

The documentation on how to create custom tokens, is to be found here: https://firebase.google.com/docs/auth/admin/create-custom-tokens

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121