question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nebular Auth Refresh Token (JWT - DRF backend)

See original GitHub issue

Hi all, I’m trying to integrate nebular-auth with a django rest framework backend server. I’m able to complete the login and to store the token. This is what I get from the server when I login:

{
    "access": "my_asccess_token",
    "refresh": "my_refresh_token"
}

and this is how I configured nebular-auth to get the access token:

NbAuthModule.forRoot({
      strategies: [
        NbPasswordAuthStrategy.setup({
          name: 'email',
          baseEndpoint: 'http://127.0.0.1:8000',
          login: {
            endpoint: '/api/token/',
            method: 'post',
          },
          register: {
            endpoint: '/auth/sign-up',
            method: 'post',
          },
          logout: {
            endpoint: '/auth/sign-out',
            method: 'post',
          },
          requestPass: {
            endpoint: '/auth/request-pass',
            method: 'post',
          },
          resetPass: {
            endpoint: '/auth/reset-pass',
            method: 'post',
          },

          token: {
            class: NbAuthJWTToken,
            key: 'access',
          }
        }),
      ],
      forms: {},
    }),

Now, I have 2 problems:

  1. The server have a 2nd endpoint for refreshing the token (/api/token/refresh/), and expects to receive the refresh_token in order to generate and send a new access_token.
  2. How should I save the refresh_token using NbPasswordAuthStrategy??

Thanks, and sorry for posting my question in the issue tracker, but there isn’t any other place to ask…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

2reactions
kgrigoriancommented, Apr 3, 2019

this functionality would still be useful

2reactions
Luca1991commented, Apr 3, 2019

Hello, we discussed internally this issue and eventually we decided to write our own auth module for Angular. We will still use Nebular as a theme engine. I’m going to close this issue.

Many thanks, Luca

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nebular Auth Unable to pass in Refresh Token (JWT - DRF ...
I am using Nebular library as part of front end and Django Rest Framework + Djoser + JWT as part of backend. I...
Read more >
How to Use JWT Authentication with Django REST Framework
JWT stand for JSON Web Token and it is an authentication strategy used by ... In order to access the protected views on...
Read more >
JWT(JSON Web Token) With DRF - Medium
JWT is a popular implementation of token based authentication. In this article we'll use it to authenticate users that JWT using with Django...
Read more >
jwt - Reddit post and comment search - SocialGrep
Overview of JWT authentication and how it works 1 ... I am learning node backend. ... Store cookie from response with JWT refresh...
Read more >
Platform SDK - Qlik Developer Portal
Access the backend services of your tenants to automate tedious and ... JWT Auth. A JWT is a digitally signed JSON web token...
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