Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to login with email and password in firebase from python using Firebase Admin Python SDK? #641

Closed
koushikromel opened this issue Sep 7, 2022 · 3 comments

Comments

@koushikromel
Copy link

This is my first question on GitHub so i thought i should write it as much as detailed if my question was too long kindly excuse me.

I'm using Pyrebase(a third party package to access firebase data) now I'm looking forward to migrate to Firebase Admin Python SDK for all my works i couldn't find this particular thing in firebase-admin

In Pyrebase i use these commands to create and login to my account using python
To create a new user auth.create_user_with_email_and_password(email, password)
To login with email and password user = auth.sign_in_with_email_and_password(email, password)

In Firebase Admin Python SDK I can create an auth with create a new user
firebase_admin.auth.create_user(**kwargs) create user documentation page
like i do in Pyrebase No issues with this.

But i couldn't find a way to login with password, here it takes email as a parameter and returns the user details
firebase_admin.auth.get_user_by_email(email, app=None) get user documentation page

So my question here is how do i authenticate user by login page by getting user email and password
I wanna know is there any other way to authenticate users in Firebase Admin Python SDK

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@arnavmehta7
Copy link

arnavmehta7 commented Sep 15, 2022

Hey,
Check below:

user = auth.create_user_with_email_and_password(email, password)

signin = auth.sign_in_with_email_and_password(email, password)

You can sign in with the above

@lahirumaramba
Copy link
Member

Hi @koushikromel The Admin SDK is used in environments with administrative privileges and login to a user account is not currently a use case that is supported by the SDK. You would want to use one of the Firebase client-side SDKs (iOS, JS, Android etc.) to sign in users from the client side code.

You can use the ID token verification API in the Admin SDK to know what user is signed in on the client side by sending the token from the client to the server and then validating it on the server side. See https://firebase.google.com/docs/auth/admin/verify-id-tokens for more on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants