验证令牌时出错。代理未在 keystone 中授权。 Keystone认证

Error validating token. Proxy not authorized in keystone. Keystone authentication

我正在尝试合并最新的 IDM (Docker) 和 pep-proxy(git 示例 运行 节点服务器)。

当我启动 pep-proxy 时,一切都按预期进行。 我收到以下消息:

  1. 信息:服务器 - 在端口 80 中启动 PEP 代理。IdM 身份验证...

  2. 服务器 - 成功验证 PEP 代理。代理授权令牌:d9badf48-16fa-423d-884c-a3e155578791

现在有问题了。当我输入错误的令牌时,我收到此错误消息。

ERROR: IDM-Client - Error validating token. 
Proxy not authorized in keystone. Keystone authentication ... 
ERROR: Server - Caught exception: 
SyntaxError: Unexpected token u in JSON at position 0

据我所知,我期待一些 return,例如无效令牌等。相反,我在 pep-proxy 和我的 curl 命令 show->(52) 来自服务器的空回复中收到此错误。

我的 config.json 的 pep-proxy:

var config = {};

// Used only if https is disabled
config.pep_port = 80;

// Set this var to undefined if you don't want the server to listen on  HTTPS
config.https = {
  enabled: false,
  cert_file: 'cert/cert.crt',
  key_file: 'cert/key.key',
  port: 443
};

config.idm = {
  host: 'localhost',
  port: 3000,
  ssl: false
}

config.app = {
  host: 'www.google.es',
  port: '80',
  ssl: false // Use true if the app server listens in https
}

// Credentials obtained when registering PEP Proxy in app_id in Account Portal     
config.pep = {
  app_id: 'xxxxxx',
  username: 'xxxxxx',
  password: 'xxxxxx',
  trusted_apps : []
}

// in seconds
config.cache_time = 300;

// if enabled PEP checks permissions with AuthZForce GE. 
// only compatible with oauth2 tokens engine
//
// you can use custom policy checks by including programatic scripts 
// in policies folder. An script template is included there
config.azf = {
  enabled: true,
  protocol: 'http',
  host: 'localhost',
  port: 8080,
  custom_policy: undefined // use undefined to default policy checks (HTTP verb + path).
 };

 // list of paths that will not check authentication/authorization
 // example: ['/public/*', '/static/css/']
 config.public_paths = [];

 config.magic_key = 'undefined';

 module.exports = config;

IDM 日志:

fiware-idm_1  | GET                                                
/user?access_token=7cb25729577c2e01dc337314dcd912ec981dc49b 401 4.445 ms -  116

fiware-idm_1  | Executing (default): SELECT email, 'user' as Source FROM  
user WHERE email='pep_proxy_edf60435-7de7-4875-85a9-cf68b8838b8c'
fiware-idm_1  |                  UNION ALL
fiware-idm_1  |                  SELECT id, 'pep_proxy' as Source FROM    
pep_proxy WHERE id='pep_proxy_edf60435-7de7-4875-85a9-cf68b8838b8c';
fiware-idm_1  | Executing (default): SELECT `id`, `password`,    
`oauth_client_id` FROM `pep_proxy` AS `PepProxy` WHERE `PepProxy`.`id` = 
'pep_proxy_edf60435-7de7-4875-85a9-cf68b8838b8c';
fiware-idm_1  | Executing (default): INSERT INTO `auth_token` 
(`access_token`,`expires`,`valid`,`pep_proxy_id`) VALUES ('a0d54a6f- 
8461-4000-bb80-5fb60193bcb4','2018-05-04 
11:45:21',true,'pep_proxy_edf60435-7de7-4875-85a9-cf68b8838b8c');
fiware-idm_1  | POST /v3/auth/tokens 201 13.733 ms - 74

错误 "SyntaxError: Unexpected token u in JSON at position 0"、 可能是由于代码中的某个地方使用 undefined 参数调用了 JSON.parse。您收到此消息是因为未正确处理错误并抛出异常(未处理异常)。

在代码的 Wilma PEP Proxy github, we can see the latest changes 中,我们可以 guess/infer 这个错误的来源。

我想你可以在 github 上提出一个问题。