我想将pep-proxy与idm连接..所以我从该链接安装了pep .. https://github.com/ging/fiware-pep-proxy通过从源代码构建它 . 那是我应该编辑的配置文件

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

我也想知道如何同时获得app_id和trusted_apps参数,我也对app_id的含义感到困惑,无论它是否是客户端ID .

这是我的问题的第一部分 .

当我把客户端ID与app id放在一起并把我在idm上注册时获得的pep代理的用户名和密码时,我得到了keystone通信错误

当我通过在开头添加“http”编辑idm主机参数时,我没有任何令牌,我得到“令牌未定义”消息 . 此外,当我通过添加idm帐户编辑用户名和密码时,每次我得到一个新的令牌 . 所以我想知道构建fiware pep-proxy的最佳方法,并使其与idm正确通信,没有任何问题 .

然后我尝试按照docker文件中的安装命令 . 在使用这些命令构建pep-proxy时,我得到了一个新的配置文件,这是fiware学术界的配置文件

enter image description here

这个配置文件与我工作的第一个不同 . 当我按照此视频https://www.youtube.com/watch?v=dtKsjGbJ7Xc&index=10&list=PLARS-yIy9nOoBIOJS05Rpkvu1pZiNTgPT中的步骤并通过放置pep-proxy的那些配置用户名和密码时,我收到此错误 .

enter image description here

在keystone参数之前放置“http”如下

config.keystone_host = 'http://cloud.lab.fiware.org';

我收到了这条消息

enter image description here

但是在配置中输入idm的用户名和密码,如下所示

config.username = 'idm_user_mail;
config.password = 'password';

我总是得到一个新的令牌 .

现在,我想知道让pep-proxy和idm一起工作的最佳方法,因为我仍在努力使它们正常通信 .

EDIT: 我已从这些链接部署了最新版本的pep-proxy和idm . https://github.com/ging/fiware-pep-proxyhttps://github.com/ging/fiware-idm . 我还配置了pep-proxy如下

// 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.com',
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: 'XXXXXXXXX',
username: 'XXXXXXXX',
password: 'XXXXXXXX,
trusted_apps : []
}

// in seconds
config.cache_time = 300;

并在启动idm和pep-proxy时,我得到一个令牌,如下面的日志
32775470_524428264620979_7740486530111635456_n
所示

这是idm的日志

32779988_524428297954309_4770390630587170816_n

当我通过发送带有提供的令牌的请求测试带有idm的pep-proxy时,我从服务器得到一个空的回复,如下所示
32764669_524428831287589_4228451219091226624_n

这些也是发送请求后pep-proxy的日志 .

32856053_524428894620916_5143172278388785152_n

编辑:我想现在我的令牌没有成功创建或我'm using deprecated API as I'使用Oeuth2-client提到在fiware学院生成令牌 https://github.com/ging/oauth2-example-client?files=1

和令牌生成成功如图所示
and token generated successfully as shown

当我点击获取用户信息时我得到了相同的错误当我尝试在pep中使用此令牌出现在Oauth2客户端并且客户端已经停止

我尝试使用不同的方式生成令牌以及如何使用此令牌我的意思是最好的和文件的稳定版本描述如何玩idm但没有问题如何创建一个有 Value 的令牌如果有一个文件兼容lems版本的idm请提及它抱歉给您带来不便

Update :我已经按照这个文件“https://www.slideshare.net/mobile/daltoncezane/integrating-fiware-orion-keyrock-and-wilma”在idm和pep proxsy之间进行通信,特别是这个代码从idm生成令牌使用postman发送它

POST to "http://idm_ip:8000/oauth2/token"
Payload:
grant_type=password&username=YOUR_USERNAME&password=YOUR_PASSWORD&cli
ent_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET

但无法生成令牌这是邮递员的回复

DOCTYPE html>错误语法错误:意外的令牌

在JSON位于JSON.parse(<anonymous>)的位置0,位于createStrictSyntaxError

(/home/ubuntu/fiware-idm/node_modules/body-parser/lib/types/json.js:157:10)
在解析
(/home/ubuntu/fiware-idm/node_modules/body-parser/lib/types/json.js:83:15)

/home/ubuntu/fiware-idm/node_modules/body-parser/lib/read.js:121:18
在invokeCallback
(/home/ubuntu/fiware-idm/node_modules/raw-body/index.js:224:16)
完成了
(/home/ubuntu/fiware-idm/node_modules/raw-body/index.js:213:7)
在IncomingMessage.onEnd
(/home/ubuntu/fiware-idm/node_modules/raw-body/index.js:273:7)
在emitNone(events.js:106:13)at
IncomingMessage.emit(events.js:208:7)at
endReadableNT(_stream_readable.js:1064:12)at
process._tickCallback的_combinedTickCallback(internal / process / next_tick.js:138:11)
(内部/过程/ next_tick.js:180:9)

这是发送请求后的idm日志

POST /oauth2/token 400 1.679 ms - 1164                                       
SyntaxError: Unexpected token # in JSON at position 0                        
    at JSON.parse (<anonymous>)                                              
    at createStrictSyntaxError (/home/ubuntu/fiware-idm/node_modules/body-par
ser/lib/types/json.js:157:10)                                                
    at parse (/home/ubuntu/fiware-idm/node_modules/body-parser/lib/types/json
.js:83:15)                                                                   
    at /home/ubuntu/fiware-idm/node_modules/body-parser/lib/read.js:121:18   
    at invokeCallback (/home/ubuntu/fiware-idm/node_modules/raw-body/index.js
:224:16)                                                                     
    at done (/home/ubuntu/fiware-idm/node_modules/raw-body/index.js:213:7)   
    at IncomingMessage.onEnd (/home/ubuntu/fiware-idm/node_modules/raw-body/i
ndex.js:273:7)                                                               
    at emitNone (events.js:106:13)                                           
    at IncomingMessage.emit (events.js:208:7)                                
    at endReadableNT (_stream_readable.js:1064:12)                           
    at _combinedTickCallback (internal/process/next_tick.js:138:11)          
    at process._tickCallback (internal/process/next_tick.js:180:9)

希望更清楚,有一个解决方案