4👍
Why reinvent the wheel? There is a plethora of reusable applications that have this implemented. You can find a comparison here: http://djangopackages.com/grids/g/authentication/
0👍
Why not give rauth a try? We use this in production for this exact purpose. Although you don’t need to require the user to login with your app via the provider, you’re going to redirect to the provider, where they’ll be asked to authenticate your application. Assuming they accept (or even if they don’t), they’ll be redirected back to your application, i.e. via the redirect_uri
or oauth_callback
, there you’ll ensure they authorized your app and then proceed with whatever housekeeping you need to do, e.g. saving some info about the user in your database. Try the examples and also pay particular attention to the Facebook example. Now the Facebook example is intended for authorization with the example web app, but the same pattern can be used for what you’re trying to do. (You just won’t be having them login in via Facebook, for instance. However, the flow can be and probably should be identical, sans database operations and template login lingo.)
- [Django]-Django's Distance function not returning a Distance object
- [Django]-Object has no attribute 'build_absolute_uri' – Django Rest Framework