Questions tagged [django-authentication]

django-authentication refers to the built-in auth module for authentication & authorization that can be extended.

django-authentication refers to the built-in auth module for authentication & authorization that can be extended. It handles user accounts, groups, permissions and cookie-based user sessions.

See documentation.

1888 questions
0
votes
0 answers

Django : Integrity error while authenticating from Google. Duplicate entry shown

I am trying to login through google in my django application . I am getting some integrity error while trying to save the user. The error is - IntegrityError at /auth/complete/google-oauth2/ duplicate key value violates unique constraint…
0
votes
1 answer

Django Models: Create custom User model when I create a normal User

I have a model called 'User profiles' that is a custom user, it takes a user in a OneToOneField and also has additional fields like 'age', 'is_teacher', 'is_location'. My Problem is that when I create a normal user, this 'User Profiles' dosen't…
0
votes
1 answer

Django, 'django.contrib.auth.views' has no attribute 'login'

I'm getting this attribute error when I am trying to import views from django.contrib.auth, and I wanna use their authentication method from django.contrib import admin from django.urls import path from django.conf.urls import url,include from…
0
votes
1 answer

How to handle django backend request for logged in user in a RESTfull manner?

I am developing a web platform that provides licence handling (e.g. creation, invoicing, downloading) for a specific software. Backend is django 2.1.7 and frontend angular. I have the following use case and I want to make sure it respects REST…
Alex
  • 37
  • 1
  • 8
0
votes
1 answer

Django_auth_ldap: User from LDAP post_save signal 'created' flag always false

I am trying to allow LDAP users to login to my Django application. Each user needs some additional attributes which I want to store in a User Profile model. I have implemented the 'post_save' signal to create the userprofile on initial login,…
0
votes
1 answer

Django password reset using user's stored email instead of user input

I am using the default Django password reset system, which has the following workflow: User clicks 'reset password' link User enters email on a page User is sent password reset link to address entered in previous step I would like this to…
Cirgue
  • 23
  • 6
0
votes
1 answer

Custom fields in Custom User model not showing up while creating user in admin

I am using a custom user model with an extra field 'uid'. While i am trying to create a new user from the admin page, the uid field is not showing up. I've created a custom user create and update form.please see the code below. models.py from…
p.ry
  • 409
  • 1
  • 8
  • 21
0
votes
1 answer

Password error when customizing Django authentication

I'm trying to customize the authentication that comes by default in Django with a table of Mysql already made (collaborators). When I want to register a user (with the command python manage.py createsuperuser) I get the following error:…
CJovany
  • 1
  • 1
0
votes
0 answers

How to add a profile page in Django 2.0 backend for staff users?

I surfed the web for something like this but I find only frontend solutions or obsolete guides. I wish to allow staff users to edit some default info such as first_name, last_name, email but also other extra info such bio, telephone, etc. I created…
0
votes
1 answer

Expiring a Django session at a specific time for a specific user (eg when their shift ends) at login

I have a system that has overlapping shift workers on it 24/7. Currently it is not uncommon for one to forget to log out and the next worker pick up their session and run with it. This causes some accountability issues. I do realise there are…
Oli
  • 235,628
  • 64
  • 220
  • 299
0
votes
0 answers

How to implement code grant flow in REST API?

I am developing web application in React and Django(Rest Framework)., i want to users can login with google account., I approach i followed is implicit grant flow.,where i get the access token in the front end., and sent the access token to the…
Hari
  • 1,545
  • 1
  • 22
  • 45
0
votes
1 answer

Django: authenticate() returns none except one case

So i am stuck at a point in my project. I am trying to create users and I have extended User model using the OneToOnefield method as recommended in Documentation to create a user profile. There is no problem in creation of the user as all the…
0
votes
1 answer

form_valid method in django-extra-views. In reality form(s)_valid

I am trying to use Django Extra Views pack to create new entry based on model + inline formset + extra information from the USER model. I know how to do it via function based views but now trying to decrease amount of the code: I have 2 models +…
0
votes
1 answer

Where is the proper place to implement "LOGOUT" function in PasswordChangeView?

Hello Stackoverflow community. Where is the best place to implement LOGOUT function in PasswordChangeView I tried class PasswordCorrectionView(SuccessMessageMixin, LoginRequiredMixin, PasswordChangeView): template_name =…
Aleksei Khatkevich
  • 1,923
  • 2
  • 10
  • 27
0
votes
1 answer

Django multiple users login and logout

Two users of the same type login. When one of the users changes the tab, now the user is the one who logged in last ({{ user.username }} changes). The more major issue for me is that once one of them logout, the other logs out automatically.…
Mahdi Ghelichi
  • 1,090
  • 14
  • 23