无法使用nuxts身份验证模块从keycloaks userinfo端点获取userinfo

时间:2019-08-02 08:58:57

标签: openid keycloak nuxt.js userinfo

在我的nuxt.js应用程序中,我正在使用nuxts“ auth”模块连接到密钥库实例。如果我只想登录,效果很好。但是,如果我在配置中设置“ userinfo_endpoint”,以通过登录名获取用户信息,则请求将失败,并显示401。

nuxt.config.js身份验证模块配置:

auth: {
    strategies: {
      keycloak: {
        _scheme: 'oauth2',
        authorization_endpoint: 'https://authenticate.someething.com/auth/realms/app/protocol/openid-connect/auth',
        access_token_endpoint:  'https://authenticate.someething.com/auth/realms/app/protocol/openid-connect/token',
        // if I remove the line with "userinfo_endpoint" the login works, but then I dont get the userinfo I need.
        userinfo_endpoint:      'https://authenticate.someething.com/auth/realms/app/protocol/openid-connect/userinfo',
        scope: ['openid', 'profile', 'email'],
        access_type: 'implicit',
        response_type: 'id_token token',
        token_type: 'Bearer',
        client_id: 'appname',
        token_key: 'id_token',
        state: 'xxx'
      }
    }
  }

vue中的登录链接调用此功能:

this.$auth.loginWith('keycloak')

keycload管理界面中是否有我没有打开的东西?

0 个答案:

没有答案
相关问题