Flask - Stripe - Firebase Auth - flask

As of right now I have firebase auth (generic email/password) set up as well as a Stripe payment stream.
What is the most simple way to link a stripe customer id to the firebase auth user credentials?
Can I somehow force the user to use the same email address to have that as a unique id?
It does not seem that I can store additional info within the authentication process but I could be wrong..

I ended up passing the email variable from firebase auth to the stripe form.
I did this by {{ email }} and adding the "Data-email" field to the provided base form code in their documentation.

Related

Django JWT Auth for custom model

I have a custom user model
class User(models.Model):
fields...
It also has a email, password field among other detail fields. I want to use the simplejwt JWT authorization which takes email and password as input and generates JWT Tokens. Most tutorials include creating a superuser and passing username password of the superuser to get the token, But I want to do this for my custom user model.
REST implementation of Django authentication system. DJOSER
Getting Started with Djoser
Also, you need a MOD HEADER which is an Extension in Chrome
Add it from here
Once your Django project is up and running go to
localhost:8000/auth/jwt/create/ for creating access token by submitting username and password (ie: POST method)
once access token is created you need to set it in MOD HEADER in Request Header and you are good to go.
it's a JSON web token that's why you need to prefix it with JWT and then access token
django-simple-jwt generates the access and refresh tokens through the obtainTokenPairView. This views calls the authenticate function from django. Therefore if you have set up a custom user model following django guidelines, to use the email in place of the username, django-simple-jwt should work out of the box
Otherwise, you still have the option to create your own view and Generate the tokens manually

Google-Oauth2 not registering new user in Django

When I implemented Google Oauth2 in my Django project,at the backend the user column in python social auths is providing admin mail as user and uid as the email of person who signed in.
Post that no new user is able to sign in.It states Type Errorenter image description here

Django Allauth - New user type using default Signup form with other forms

I have created a seller app which allows sellers to apply for a seller account. I am using allauth signup form and 2 other custom forms for collecting information apart from username, email and password (collected by allauth signup form). The other info that I need has Seller Name, Mobile number etc. and also collects seller address.
I have a class based form view created and these views captures Seller info and Adresss info but I do not know how to send the signup information to create the new (seller) via allauth. How can I create the user within seller account apply view?

Where in database does python-social-auth store access token?

I am using python-social-auth (within django) to implement facebook-login. I am able to successfully sign into my app using facebook and extract user email. But where in the database can I find the OAuth token generated by facebook? Is it in the password field in the user table?
It's in the UserSocialAuth extra_data field which is a JSONField.
Example of the value stored:
{"expires": "5184000", "id": "00000000000000000", "access_token": "the-token-value"}

django-allauth passwords with social registration

Basically, the goal is to have valid username/password pair for each registered user.
I think the proper way to do that is to create custom form for social signup.The default workflow for social signup is:
User clicks "Sign in with PROVIDER_NAME";
User gives access to my app on provider's site;
Site redirects him to my app where he should fill additional fields like username etc. and complete registration.
And I need to ask user for passwords too at the last step. Form should validate that passwords and save it to user.
Any ideas? Have no idea how can it be implemented with custom form or adapter.
The purpose of allauth, is to avoid the user to create a new username/password for your site.
However, you can configure a form to add that information.
Set up the form you want to show to the user.
ACCOUNT_SIGNUP_FORM_CLASS = 'project.forms.MyUserForm'