Comments (4)
@omab - it'd be nice if this was in the docs somewhere... It'd also be good if there was a method that retrieved the token for you since it may be in request.GET
or in request.SESSION
. I used the following to get the token (but I don't like that I had to hard code the default get arg name of partial_token
):
token = request.GET.get(getattr(settings, 'SOCIAL_AUTH_PARTIAL_PIPELINE_TOKEN_NAME', 'partial_token')) or request.session.get('partial_pipeline_token')
from social-app-django.
The partial pipeline data is now stored in the database to allow reuse between browsers, basically we store the same data we used to store in the session, but in a db table now, then we generate a token that can be stored in the session or just appended to any URL using the partial_token
parameter name (can be overridden by SOCIAL_AUTH_PARTIAL_PIPELINE_TOKEN_NAME
setting).
The pipeline functions will get a current_partial
instance which has a token
attribute, also has a backend
attribute with the current backend name, which can also be accessed through the backend
parameter.
Check the require_email example.
from social-app-django.
@ip2176, you can get the current partial by doing:
from social_core.pipeline.utils import partial_load
from social_django.utils import load_strategy
strategy = load_strategy(request)
partial = partial_load(strategy, token)
from social-app-django.
Hello, @omab if you could, I am discovering that I am hitting this error also. This example explains how to get the backend if I am in a partial pipleline function, however, I need to access the backend in a view:
def donor_collect_details(request):
if request.method == 'POST':
request.session['password'] = request.POST.get('password')
request.session['username'] = request.POST.get('username')
request.session['first_name'] = request.POST.get('first_name')
request.session['last_name'] = request.POST.get('last_name')
request.session['email'] = request.POST.get('email')
backend = request.session['partial_pipeline']['backend']
return redirect('social:complete', backend='')
return render(request, 'user/donor_collect_details.html', {'form': DonorRegistrationForm()})
We want to collect the username and information manually even when the user uses a facebook or google login, so I am trying to insert this partial into the pipeline, and I just don't know how to get the backend in a regular views.py file. Thanks!
from social-app-django.
Related Issues (20)
- Social Auth with Gmail SSO Causing Error --> 'str' object has no attribute 'get' HOT 2
- 5.2.0 not compatible with Django >= 4.2.2
- How to override a field of `AbstractUserSocialAuth` HOT 1
- IrreversibleError when migrating app zero for a new DB HOT 1
- Subclassing AbstractUserSocialAuth creates migration in social_django app. HOT 1
- 5.3.0 migrations feedback HOT 9
- Deprecated Sign In with LinkedIn HOT 2
- Enhance Django OAuth Library for Clean JSON Responses in API Development
- Linkedin complete login step is stuck
- AWS Cognito - Invalid scope error on authentication request HOT 1
- Update to social-core 4.5.2 HOT 1
- OPEN FOR MAINTAINERS
- Problem with facebook when email is added to scope, redirect url is not correct
- Accidental incompatible behavior change in version 5.4.1 HOT 2
- AttributeError: 'NoneType' object has no attribute 'provider' HOT 3
- [Help] Best practice for multiple browser/client connection?
- Google OAuth not working on production server (hosted on heroku), works fine on localhost
- Bug in social_auth.social_user pipeline stemming from AbstractUSerSocialAuth.get_social_auth HOT 2
- Reauth Gitlab doesn't work HOT 2
- Reauth Gitlab doesn't work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from social-app-django.