I need to authenticate on some of atlassian services(wiki for example) and on AD(ActiveDirectory). The problem is I don't know how to make authentication in different back-ends so user input password and log-in only once and then backends authenticate user on different services. As I read in docs - django iterates through list of backends till user wouldn't be authenticate on django site. Or maybe i at all think in a wrong way?
How should I login on other services? I know about CROWD but guess it doesn't cover functionality for login on my MSSQL DB.
you can customize authenticate mechanization by provide your own back-ends.
see https://docs.djangoproject.com/en/dev/topics/auth/customizing/
Related
I created a Django application that integrates with Keycloak's OpenID authentication. So far the only pressing issue I've encounted is the logout function.
When I log out via the Django app, I could implement it such that it logs the user out of the Keycloak as well. However, I could not find a way to perform the reverse. Logging out via Keycloak account management interface does not log the user out from the Django app. This means that the user can still remain authenticated on the Django app even though he is already logged out of Keycloak, which appears to be a security concern.
From what I understood from most other similar StackOverflow post, Keycloak supposedly has a way to call back to web application to logout the user, but however it is not very clearly documented on how to implement it:
https://www.keycloak.org/docs/latest/securing_apps/index.html#admin-url-configuration
Does anyone have any idea how this can be implemented on django?
I used Django 2.1 + mozilla-django-oidc package.
I'm building a Django web app with django-allauth handling user authentication.
As title, how do you expose a RESTful API to authenticate users from a Chrome extension? Taking into account of both:
locally stored username & password hash string pairs and
third party social log-in providers?
What is the best or simplest way to do this?
I found the best solution to be Django-Rest-Framework.
I installed DRF, and wrote a serializer for my User model and an API view to handle token authentication.
I have visited a couple of sites and they offer the option to try their site without registering, but you can login with something like someusername#somesite.com and somesiteguest.
I want to implement this for my own site. Currently I am using django-allauth for handling registration and logins.
I am just not sure how to handle users login with the same credentials.
can connect to facebook and twitter, but how do i connect a normal django user to both his facebook and twitter networks, so that the next time he has the option of logging in through any 1 of the 3 and i can utilise information from both the networks.
can the signal :-
allauth.socialaccount.signals.pre_social_login
be used to check if a user is already logged in if yes connect the social account to the django account, but i cant figure out how to go about implementing this in the login view.
connecting to different social providers turned out to be pretty easy. The same url which was used to login the users to a social provider if accessed inside a users home page( ie the page a normal django user will see after logging in using django auth) links your django profile to the social app profile automatically.
now I am looking into how to use the graph api along with allauth to fetch friend lists, post to wall etc
I don't understand how you handle authentication when using django and backbone.js.
Lets say I have an app where users can sign up / sign in. Normally in django I'd just use the #login_required decorator with my views to test if a users is authenticated or not. Since backbone is RESTful and uses something like json to communicate with the server, it's my understanding it doesn't have a concept of being logged in.
So how do I create an django backbone app that uses django's auth system so I can still take advantage of permissions, groups and session based auth.
You may find it easier to keep your login and logout code in django normally, and only go to a Backbone-based template once the user is logged in. Many sites work this way.
You will also want to watch for 401 errors coming back from the server when you sync, since this can mean that the user's session has expired. (I assume django sends these.)