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..
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
this functionality would still be useful
@kgrigorian why the thumbs-down emoji on my post? I would love to see that feature on nebular too, but since it is missing and we need it ASAP we decided to code our own solution for managing the access token and the refresh token, and we opted for a simpler implementation.
That said, feel free to re-open this issue or create another one.
pleas help me out with refresh token
@Luca1991 I am also stuck on this problem, it seems Nebular doesn't have a method to get the refresh token from the Django token response. Would you mind explaining to me how your custom solution works?