Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用KeyClope使用automaticSilentRenew选项更新nuxtJS vuex oidc令牌时出现无效的_Grant错误_Javascript_Vue.js_Authentication_Oauth 2.0_Nuxt.js - Fatal编程技术网

Javascript 使用KeyClope使用automaticSilentRenew选项更新nuxtJS vuex oidc令牌时出现无效的_Grant错误

Javascript 使用KeyClope使用automaticSilentRenew选项更新nuxtJS vuex oidc令牌时出现无效的_Grant错误,javascript,vue.js,authentication,oauth-2.0,nuxt.js,Javascript,Vue.js,Authentication,Oauth 2.0,Nuxt.js,我想在使用vuex oidc库使用nuxtJS登录时更新KeyClope访问令牌,但是当令牌过期且用户注销时,我会收到错误invalid grant。每当令牌过期时,我需要用户保持登录状态,并通过刷新令牌请求新的令牌 Error: ... / protocol / openid-connect / token 400 我尝试在oidcSettings中添加以下内容: export const oidcSettings = { authority: process.env.oauth2.ho

我想在使用vuex oidc库使用nuxtJS登录时更新KeyClope访问令牌,但是当令牌过期且用户注销时,我会收到错误invalid grant。每当令牌过期时,我需要用户保持登录状态,并通过刷新令牌请求新的令牌

Error: ... / protocol / openid-connect / token 400
我尝试在oidcSettings中添加以下内容:

export const oidcSettings = {
  authority: process.env.oauth2.host,
  clientId: process.env.oauth2.client,
  redirectUri: `$ {process.env.baseUrl} / oidc-callback`,
  responseType: 'code',
  scope: 'openid email',
  automaticSilentRenew: true,
  automaticSilentSignin: true,
  silentRedirectUri: `$ {process.env.baseUrl} / oidc-silent-callback`
}
在oidc静默回调中,我添加了以下内容:

import {vuexOidcProcessSilentSignInCallback} from 'vuex-oidc'

export default {
  layout: 'empty',
  name: 'OidcSilentCallback',
  created () {
    if (process.client) {
      try {
        vuexOidcProcessSilentSignInCallback ()
      } catch (err) {
        // eslint-disable-next-line
        console.error (err)
        this. $ router.push ('/ signin-oidc-error') // Handle errors any way you want
      }
    }
  }
}
我不太明白是否需要automaticSilentSignin,或者是否只有automaticSilentRenew才应该发出令牌更新请求