python-social-auth | Social auth
kandi X-RAY | python-social-auth Summary
kandi X-RAY | python-social-auth Summary
Social auth made simple
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of python-social-auth
python-social-auth Key Features
python-social-auth Examples and Code Snippets
Community Discussions
Trending Discussions on python-social-auth
QUESTION
I have create a custom user model for my project. I am using python-social-auth to log the user in. Logging in and getting the user data to database works fine but when I go to admin panel to change something manually I get this error. Even if I am not changing anything and just click save I get the same.
Why is this happening?
Models.py
...ANSWER
Answered 2022-Feb-05 at 13:55it is because you have not defined __str__()
method on your CustomUser model
in your case with Customuser model, return self.username
IMO when using django-admin __str__()
method IS MANDATORY on any model for clarity purpose
read more here : https://docs.djangoproject.com/en/4.0/ref/models/instances/#str
QUESTION
I am new to this so sorry if what I am asking sounds silly. I am using only steamopenid on python-social-auth for the login, that's the only option the customer will have. Now I want to create my own custom user model where I can keep the user data once they log in. I believe it should not be too complicated but I can't find anything that seems correct.
I have managed to get username but I want to also get everything that's under user social auths table and users table. The fields that are saved into python-social-auth generated table:
settings.py
...ANSWER
Answered 2022-Feb-03 at 17:45You created a model which has a reference to the default user model of django. But I think that you want is customize your own model user. The option that i prefer is code a new model that inherits from AbstractBaseUser
, which just have a few fields and you be able to add your own needed fields (if you want to use the admin site make sure of append is_staff
, is_superuser
and to make better control override is_active
).
The last step is change in settings.py
to use this model as your user model. I
QUESTION
I am following Django dj4e course. While going through setup that is linked here https://www.dj4e.com/assn/dj4e_ads1.md?PHPSESSID=991c1f9d88a073cca89c1eeda44f61d2 I got this weird error:
...ANSWER
Answered 2021-Dec-05 at 21:46I think something went wrong and executed the line import \n 'hello'
by accident.
QUESTION
I want to add data (such as the token expiration date or user info) to the payload of the JWT generated by this library.
The current decoded payload of a JWT generated by this library is the following:
...ANSWER
Answered 2021-Apr-14 at 23:02drf-social-oauth2
doesn't provide a mechanism to easily override this setting, it overrides oauth2_provider.settings.ACCESS_TOKEN_GENERATOR
with their generate_token
method (https://github.com/wagnerdelima/drf-social-oauth2/blob/master/drf_social_oauth2/settings.py#L11-L14), this method doesn't include extra values, only the token.
You can do the same on your side overriding the value with a custom method that adds the needed keys.
QUESTION
I am working on a codebase using Django 1.9, I am busy getting everything ready to upgrade to 1.10.
I have run into an issue after migrating from python social auth to python social auth app django. I have used the steps found here
After updating my settings and url files, I ran into the below error. Does anyone know how I can get around this?
...ANSWER
Answered 2020-Jul-31 at 16:09This usually happens when you upgrade the module and the newer module's models have new constraints, in your case
column "modified" contains null values
One way is to delete just the instance that are causing the error. For this, go to the migrations folder and delete manually files that have 0009_auto_20191118_0520
type of name, you can delete, probably all, but 0001_initial.py file
. After that run
python ./manage.py make migrations social_django
, it should update your database.
You can also consider clearing the migration history for the social_django app, with the cmd
QUESTION
I'm using python-social-auth to allow my users to register via Apple and Google. I'm trying to figure out how via REST I can associate social accounts to an existing user with a different email than the social account (project req is that users are manually created in the backend and then can associate a social login for ease-of-access). This is a React Native app so the usual automatic way of active sessions won't work. I'm using https://github.com/st4lk/django-rest-social-auth to create easy endpoints.
Thanks in advance y'all.
...ANSWER
Answered 2020-Aug-12 at 16:55I got it working. I ended up doing this by creating an associated_email
field on profile model for each social auth service, and writing a customized version of associate by email
step in the pipeline that verifies against that field.
Thanks y'all.
QUESTION
...
ANSWER
Answered 2020-Jul-22 at 09:54The problem must lie in the object stored in variable request
.
You get the value for request
in a function which should return a complex object, which is subscriptable and has a field called 'user type'
. Obviously, it did not return this object but just returned None
, probably because of an i/o-error or an invalid argument.
Whatever function you use to get the request, I suggest checking, whether it works and what exactly it returns.
QUESTION
I am using python-social-auth
in my django project to use social platforms for authentication in my project. It all worked well but am getting this error ModuleNotFoundError: No module named 'jose'
This is the whole error:
ANSWER
Answered 2020-Apr-06 at 13:59pip3 install social-auth-core[openidconnect]
QUESTION
With Django and social-auth-app-django, I can authorize with https://github.com
with social_core.backends.github.GithubOAuth2
backend.
And I'm trying to switch it to our GitHub Enterprise based on this documentation; https://python-social-auth.readthedocs.io/en/latest/backends/github_enterprise.html#github-enterprise
Here is my settings.py
:
ANSWER
Answered 2020-Feb-13 at 07:04"{% url 'social:begin' 'github' %}"
should be "{% url 'social:begin' 'github-enterprise' %}"
.
QUESTION
Seems like this isn't a unique problem, but I'm missing something in the solution. I'm using python-social-auth
and logging in with Google. All seems to be going well, until it gets to the create_user
part of the pipeline. I do have a custom User model and UserManager. On my User model I do have a role
property that is hooked up to some choices
. When social auth kicks in and logs someone in, it does call create_user
in my User manager, however it's only passing email, and no additional fields. I was attempting to hook into the pipeline and add the required role
property by adding it to the details
social auth dict, but that doesn't seem to have any effect. How should I go about hooking into the create user property to add fields that won't exist as far as social auth is concerned?
User Model
...ANSWER
Answered 2020-Jan-29 at 05:20The reason this isn't working is that the create_user
function explicitly filters the contents of details
to include only keys specified in a USER_FIELDS
setting. This defaults to
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install python-social-auth
You can use python-social-auth like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page