Questions tagged [django-rest-auth]

Django-rest-auth provides a set of REST API endpoints for Authentication and Registration

Django-rest-auth provides a set of REST API endpoints for Authentication and Registration

Features

  • User Registration with activation
  • Login/Logout
  • Retrieve/Update the Django User model
  • Password change
  • Password reset via e-mail
  • Social Media authentication

Resources

Documentation: https://django-rest-auth.readthedocs.io/en/latest/

GitHub repo: https://github.com/Tivix/django-rest-auth

jQuery demo: https://github.com/Tivix/django-rest-auth/tree/master/demo

AngularJS demo: https://github.com/Tivix/angular-django-registration-auth

584 questions
12
votes
2 answers

After login the `rest-auth`, how to return more information?

I use django-rest-auth in my Django project. After login the rest-auth/login/, how to return more information? In the rest-auth/login/, when I login the user, it returns a key. I want to also return the user's information, how can I get this?
aircraft
  • 25,146
  • 28
  • 91
  • 166
12
votes
11 answers

DRF auth_token: "non_field_errors": [ "Unable to log in with provided credentials."

Both JWT packages written for Django gave me issues with poor documentation, so I try DRF-auth_token package. This is a good example I followed, Django Rest Framework Token Authentication. You should in theory be able to go…
codyc4321
  • 9,014
  • 22
  • 92
  • 165
12
votes
1 answer

Token authentication does not work in production on django rest framework

I have this strange issue and I can't find why. I've build the API using django 1.7 and django rest framework and token auth for api authentication. All works fine on local host, but when I'm trying to call an API endpoint which requires…
11
votes
3 answers

django-rest-framework - POST Request returns "Method \"GET\" not allowed."

I have set up django-rest-auth as per the installation tutorial, yet I am not able to use the login API endpoint. When I send a POST request with the correct information, I receive a 405 status error in response with "Method "GET" not…
Priyam Mohanty
  • 461
  • 4
  • 15
11
votes
1 answer

django-rest-auth reset password uid and token

Our team works on project with django-rest-api on backend and react on frontend. For authentication we use django-rest-auth, and we have problem with password reset. Here urls: urlpatterns += [ url(r'^accounts/', include('allauth.urls')), …
okay
  • 190
  • 2
  • 10
11
votes
1 answer

drf django rest auth how to expire or delete token?

I am trying to implement authentication using django-rest-framework and django-rest-auth by tivix (link to documentation). I created a user using django shell like: from django.contrib.auth.models import User user =…
Manish Gupta
  • 4,438
  • 18
  • 57
  • 104
10
votes
5 answers

Django CSRF Failed: CSRF token missing or incorrect

I'm using Django Rest Framework and also django-rest-auth. I've the standard API endpoints (/login, /logout, /registration...) With my browser, I can login/list my users/logout. With Insomnia (a API requester), I can't login/logout, I've the…
Isador
  • 121
  • 1
  • 1
  • 6
10
votes
2 answers

How to save extra fields on registration using custom user model in DRF + django-rest-auth

Using Django REST Framework (DRF), with django-rest-auth, I created a custom user model with one extra field. My aim is to use the django-rest-auth registration endpoint to register a new user in one request, and thus sending all the data to create…
10
votes
1 answer

Is there any way to change view of Django-rest-auth of login?

I've created rest APIs using Django-rest-auth, in login, it's returning key and some user info, But I need to add some status like success and message and some other things. Is there any way to override view of django-rest-auth for login? class…
Kashyap
  • 157
  • 3
  • 15
10
votes
4 answers

Django + DRF: 403 FORBIDDEN: CSRF token missing or incorrect

I have an Android client app that tries to authenticate with a Django + DRF backend. However, when I try to login, I get the following response: 403: CSRF Failed: CSRF token missing or incorrect. The request is sent to…
10
votes
1 answer

DRF: how to integrate django-rest-framework-jwt to Djoser

I am planning to build an application with Django Rest Framework. I'm more interested in using Django-Rest-Framework-JWT authentication mechanism than Session or Token authentication mechanism. But all the other packages like Django-Rest-Auth and…
nabeel
  • 1,181
  • 2
  • 10
  • 24
9
votes
2 answers

How to disable verification step for all-auth? (sending verification email )

I'm using all-auth (all-auth-rest) for basic authorization/authentication. By default, when the user register, Django all-auth is trying to send a verification email. How can I disable it to prevent it from sending a verification email?
merry-go-round
  • 4,533
  • 10
  • 54
  • 102
9
votes
1 answer

Django rest auth with Allauth

I have implemented django rest auth with Allauth and its working fine if I login through google access_token but there is a case when some client device need to login by google id_token. I am getting error if I use id_token instead of…
8
votes
2 answers

django-rest-auth custom registration fails to save extra fields

I am using DRF and for login/registration I am using Django-rest-auth. I have customized User model to have extra fields I have custom registration serializer to store extra fields along with username, password while registering a new…
Thinker
  • 5,326
  • 13
  • 61
  • 137
8
votes
1 answer

Field name `username` is not valid for model

I am attempting to use rest-auth supplied serialisers to GET (*with headers) user details from the defined endpoint /rest-auth/user/ (*with headers (Content-Type: application/json Authorization: Token 1a5472b2af03fc0e9de31fc0fc6dd81583087523 )) I…
1
2
3
38 39