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
6
votes
1 answer

My 'access_token' from facebook is "incorrect value"

I'm using django-rest-auth which is "API extension for Django all-auth". I'm building a mobile app which can signup/login using Facebook token (url: http://localhost:8000/rest-auth/facebook/). get Facebook token using 'expo' export const…
6
votes
3 answers

django rest auth returns AnonymousUser

I am using django, drf and django-rest-auth. I send token from frontend in request header {'Authorization': 'Token {$Token}'} But this request seems like unauthorized. I want to get users information like: def get_user_info(request): …
Farid
  • 63
  • 1
  • 7
6
votes
1 answer

Angular 2 Login to Django Rest Framework Backend

I am using Angular 2 as my front-end and Django Rest Framework on the backend to build a webapp. I have set up a basic Angular 2 app that pulls data from my Django Rest Framework backend. The Django Rest Framework backend has the 'api-auth' url…
dd_123
  • 93
  • 1
  • 7
6
votes
2 answers

django rest auth email validation

Can someone explain how to set up email verification for django rest auth ? My settings.py contains: EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' ACCOUNT_EMAIL_VERIFICATION = 'mandatory' ACCOUNT_AUTHENTICATION_METHOD =…
Ben
  • 3,972
  • 8
  • 43
  • 82
6
votes
1 answer

Django, Angular, & DRF: Authentication to Django backend vs. API

I'm building an app with a Django backend, Angular frontend, and a REST API using Django REST Framework for Angular to consume. When I was still working out backend stuff with a vanilla frontend, I used the provided Django authentication to handle…
dkhaupt
  • 2,220
  • 3
  • 23
  • 37
6
votes
1 answer

Format ValidationError in Serializer

DjangoRestFramework seems to handle errors with a variety of ways. The ValidationError in the serializer class does not consistently return JSON the same. Current response includes a JSON list/object string: {"detail":["Unable to log in with…
6
votes
1 answer

django rest-auth get user profile

I´m a little bit lost... I´m trying to develop an ionic app witch needs to be authenticated versus Django web application. I installed Django-Rest-Framework and Django-Rest-Auth. I´m able to login, getin the user with the token, but how can I…
Kioko Kiaza
  • 1,378
  • 8
  • 28
  • 57
5
votes
2 answers

Django Rest Auth - UID invalid value error

I have a DRF server, and I've been trying to send a password reset email, using the PasswordResetForm. I receive an email as expected, though when trying to send a reset the password, I receive: { "uid": [ "Invalid value" ] } After…
5
votes
2 answers

overriding restauth password reset email issues

Good day, I am trying to override the password_reset_email of Django allauth. the issue is that it successfully overrides but I get the html code just sent to the user instead of the html representation. I was expecting a styled email just like I…
5
votes
2 answers

Is there any way to get current user from the request? I am getting annonymous user even though user is loggedin

This is my first app in Django + React so I am not professional. I am writing view-set and trying to get the current user from the request but I got anonymous user even though the user is logged in. My frontend is in React and I am using…
5
votes
1 answer

API Root doesn't have has_permissions with JWT_Authentication

Trying to implement djangorestframework_simplejwt in accordance with DRF. After implementing everything based on: https://simpleisbetterthancomplex.com/tutorial/2018/12/19/how-to-use-jwt-authentication-with-django-rest-framework.html and when I'm…
user10973829
5
votes
1 answer

How to test api that uses django-rest-auth token authentication?

I am using django-rest-auth for authentication and using token provided by it for authorization. I have use some permission_class also provided by django-rest. I have folloging in views.py before my each…
5
votes
1 answer

django-rest-auth reset password email contains 'example.com ' domain instead of site_domain

I'm using django-rest-auth in my project and want to customize the email template used when resetting a password. If I send a POST request at /rest-auth/password/reset/ with user email the request works but the email I receive is: email: from…
Just trying
  • 484
  • 1
  • 5
  • 15
5
votes
0 answers

Django CSRF fails on POST request for chrome extension only

I'm requesting for a key using POST method as following, var session_id; // to use for token based authentication // prep $(document).ready(function(){ // sending a csrftoken with every ajax request function csrfSafeMethod(method) { //…
Fallen
  • 4,435
  • 2
  • 26
  • 46
5
votes
2 answers

Django token authorization - customizing obtain_jwt_token by overriding ObtainAuthToken class

My goal is to override obtain_jwt_token in order to get more control over the return value of the procedure, and in the doc I found only a bizarre and sketchy info on how to do this: Note that the default obtain_auth_token view explicitly uses…
Crazy Frog
  • 495
  • 8
  • 17