rishi95
rishi95

Reputation: 67

Firebase Token Authentication using Django

I am new to django and am trying to get the user authenticated using firebase admin sdk. I am trying to do token authentication and have setup the admin sdk in my django app. Also I have received the client id token in the android app.

Now I am unable to understand how to send this id to the backend and verify it as a user and create users accordingly.I did find this answer but couldn't really understand how to go about this.

Also if a user is verified how do I add and update its data. Do I pass the token again or is there any other way to do it?

Upvotes: 5

Views: 5644

Answers (1)

Hiranya Jayathilaka
Hiranya Jayathilaka

Reputation: 7438

Your Android App should send its ID token along with all requests sent to the backend server. You can decide how to include that (as a header, as part of a JSON payload etc). In the backend server, you should always call auth.verify_id_token() and return an error (e.g. 401 Unauthorized) if the token fails to validate.

Upvotes: 2

Related Questions