Unable to access verify_token and confirm endpoints

See original GitHub issue

Hello,

I am probably doing something silly wrong, but I’ve been unable to use the /reset_password/confirm/ and /reset_password/validate_token/ endpoints.

I am able to post to /reset_password/, generate the token, receive the signal and send the email.

path('api/password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),

I have the above in my urls.py

When I go to: http://127.0.0.1:8000/api/password_reset/reset_password/ I can post an email to request a token.

When I go to: http://127.0.0.1:8000/api/password_reset/reset_password/validate_token/ or http://127.0.0.1:8000/api/password_reset/reset_password/confirm/ there is no change from http://127.0.0.1:8000/api/password_reset/reset_password/, this is what I see:

image

Any idea why this is the case?

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
SethThoburncommented, Jun 16, 2020

I had the same problem, but I think I have fixed it. It may just be inaccurate documentation. If you do not use the “password_reset” prefix, they work fine.

I have the following line in my url conf: path('password-reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),

I can then access the endpoints: Generate token: http://127.0.0.1:8000/may-app/password-reset/ Confirm token: http://127.0.0.1:8000/my-app/password-reset/confirm Validate token: http://127.0.0.1:8000/my-app/password-reset/validate_token

It seems that generate token actually works for any url that doesn’t match any others.

Hope this helps.

1reaction
HymanZHANcommented, Jun 22, 2020

+1 for @SethThoburn

If you look closer, django_rest_passwordreset.urls does not include any reset_password prefix:

""" URL Configuration for core auth
"""
from django.conf.urls import url, include
from django_rest_passwordreset.views import reset_password_request_token, reset_password_confirm, reset_password_validate_token

app_name = 'password_reset'

urlpatterns = [
    url(r'^validate_token/', reset_password_validate_token, name="reset-password-validate"),
    url(r'^confirm/', reset_password_confirm, name="reset-password-confirm"),
    url(r'^', reset_password_request_token, name="reset-password-request"),
]

The documentation is quite misleading and should be updated. I can create a quick PR if there isn’t an existing one.

Update: I created a PR just now #101.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Strategy.prototype.jwtVerify: cannot verify token. When using ...
We are migrating our application from the AzureAD v1.0 endpoint to AzureAD v2.0, but after doing ... But It can't validate the Access...
Read more >
Validate Access Tokens - Auth0
Describes how to validate an access token. ... If any of these checks fail, the token is considered invalid, ... Verify token audience...
Read more >
Unable to validate the token from Keycloak - Stack Overflow
To validate a token get the public key from the jwks_uri (JSON Web Keys) endpoint of OpenID Connect standard set ...
Read more >
Error AADSTS500083: Unable to verify token signature. No ...
I am receiving a persistent Error: AADSTS500083: Unable to verify token signature. No trusted realm was found with identifier 'https://...'!.
Read more >
Verify the Google ID token on your server side | Authentication
After Google returns an ID token, it's submitted by an HTTP POST method request, with the parameter name credential , to your login...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found