Closed jiboule closed 2 years ago
My Oauth2 flow is working fine, I get my accessToken and can request my API. My problem occurs when the accessToken is expired.
It seems that either the refreshTokens function does nothing nor the token is refreshed automatically by auth.
I set the validity duration of my acces tokens to 60 seconds on purpose for the tests.
Here is my config :
strategies: { my_strategy: { scheme: 'oauth2', endpoints: { authorization: 'https://api.local/oauth2/auth', refresh: { url: 'https://api.local/oauth2/refresh', method: 'post' }, // seems to not being used token: undefined, userInfo: 'https://api.local/api/me/profile', logout: 'https://api.local/oauth2/logout', }, token: { property: 'access_token', type: 'Bearer', maxAge: 60 // 60 seconds on purpose }, refreshToken: { property: 'refresh_token', maxAge: 60 * 60 }, responseType: 'code', codeChallengeMethod: 'S256', grantType: 'authorization_code', accessType: undefined, redirectUri: process.env.OAUTH2_REDIRECT_URI, logoutRedirectUri: undefined, clientId: process.env.API_KEY, scope: [], } }
When I call refreshTokens programmatically :
refresh() { this.$auth.refreshTokens(); // nothing happens here }
Am I supposed to extend axios by myself and implements the refresh token flow ? If so, what is the point to configure refresh token in the scheme ?
If refresh token is available and not expired. This only works when logged in.
My Oauth2 flow is working fine, I get my accessToken and can request my API. My problem occurs when the accessToken is expired.
It seems that either the refreshTokens function does nothing nor the token is refreshed automatically by auth.
I set the validity duration of my acces tokens to 60 seconds on purpose for the tests.
Here is my config :
When I call refreshTokens programmatically :
Am I supposed to extend axios by myself and implements the refresh token flow ? If so, what is the point to configure refresh token in the scheme ?