簡體   English   中英

驗證令牌時出錯。 代理未經Keystone授權。 梯形驗證

[英]Error validating token. Proxy not authorized in keystone. Keystone authentication

我試圖合並最新的IDM(Docker)和pep-proxy(與節點服務器一起運行的git示例)。

當我開始使用pep-proxy時,一切都按預期進行。 我收到以下消息:

  1. INFO:服務器-在端口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

據我了解,我期待一些返回,例如無效的令牌等。相反,我在pep-proxy和curl命令show->(52)中收到此錯誤,來自服務器的空回復。

我的pep-proxy的config.json:

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

該錯誤“語法錯誤:意外的令牌ü在JSON在位置0”, 這里說 ,可能是由於在其中代碼一些地方JSON.parse被稱為具有undefined參數。 之所以收到此消息,是因為未正確處理錯誤,並且引發了異常(未處理異常)。

Wilma PEP代理github中 ,我們可以在代碼中看到最新的更改 ,並且可以猜測/推斷出此錯誤的來源。

我認為您可以在github上打開一個問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM