我是一个团队的一员,该团队正在开发一个使用Fiware GE的应用程序,它是智能农业食品加速器的一部分。我们使用Orion上下文代理来收集传感器网络提供的数据,并且我们打算使用Pep-代理来验证传感器节点以访问Orion实例。我们已经尝试了以下胡椒pepProxy:
https://github.com/telefonicaid/fiware-orion-pep
https://github.com/ging/fi-ware-pep-proxy
我们只有成功地实现了第二个代理(fi-ware-pep-代理)的实现。使用fiware-orion-pep,我们还无法连接到Keystone全局实例(account.lab.fi-ware.org),我们已经尝试了account.lab.Cloud.lab.我的问题是:
1)用于身份验证的keystone实例是account.lab还是cloud.lab?要使用哪个端口或者地址是什么?
2) fiware-orion-pep是否已准备好在Account.lab.fi-ware.org上进行身份验证?我问这个问题的方式如下:
这个命令可以使用>> Cloud.lab.fiware.org上的curl命令:4730/v2.0/tokens
{
"auth": {
"passwordCredentials": {
"username": "<my_user>",
"password": "<my_password>"
}
}
}'这个不适用于>> account.lab.fi-ware.org:5000/v3/auth/tokens上的comand。
{
"auth": {
"identity": {
"methods": [
"password"
],
"password": {
"user": {
"domain": {
"name": "<my_domain>"
},
"name": "<my_user>",
"password": "<my_password>"
}
}
}
} }'3)我应该使用什么实现来验证设备或对Orion实例的其他调用?
下面是我使用的配置:
fiware-orion-pep
config.authentication = {
checkHeaders: true,
module: 'keystone',
user: '<my_user>',
password: '<my_password>',
domainName: '<my_domain>',
retries: 3,
cacheTTLs: {
users: 1000,
projectIds: 1000,
roles: 60
},
options: {
protocol: 'http',
host: 'account.lab.fiware.org',
port: 5000,
path: '/v3/role_assignments',
authPath: '/v3/auth/tokens'
}
};fi-ware-pep- at (这一个工作),我已经在源代码中将列表端口设置为1026。
var config = {};
config.account_host = 'https://account.lab.fiware.org';
config.keystone_host = 'cloud.lab.fiware.org';
config.keystone_port = 4731;
config.app_host = 'localhost';
config.app_port = '10026';
config.username = 'pepProxy';
config.password = 'pepProxy';
// in seconds
config.chache_time = 300;
config.check_permissions = false;
config.magic_key = undefined;
module.exports = config;提前谢谢.)
发布于 2015-04-13 06:29:26
目前,PEP代理在如何针对全局实例进行身份验证和验证方面存在一些差异,因此它们的行为方式并不完全相同。
在telefonicaid/fiware-orion-pep中的开发是为了满足PEP代理需求(基于Keystone和访问控制的验证和验证),在单独的项目中使用它们自己的Keystone和Keypass (一种访问控制的味道),因此它的发展速度比在ging/fi-ware-pep代理中的开发速度更快,并且方向略有不同。例如,前者使用fiware-service和fiware-servicepath报头支持多租户,而后者对这些机制是透明的。这个开发方向还意味着,功能有时与全局实例中的功能略有不同。
尽管如此,具体的答案是:-两个PEP代理应该能够联系到全球实例。如果一个人没有,请,填补一个缺陷,在问题的Github存储库,我们将尽快修复它。-ging/fi-ware-pep代理是专门为访问全局实例而设计的,因此您应该能够按照预期使用它。
如果您试图继续使用telefonicaid/fiware-orion,还请注意:-配置标志authentication.checkHeaders应该是假的,因为全局实例目前不支持多租户。-当前的稳定版本(0.5.0)即将更改到下一个版本(可能是今天),因此可能会有一些问题在更新后得到解决。
希望这能澄清你的一些疑虑。
发布于 2015-04-13 15:35:33
编辑
1)我已经从源安装了telefonicaid/fiware-orion(v0.6.0),并在github中提供的教程之后创建的rpm包中安装了这个包。在创建rpm包时,它的名称是pep-proxy-0.4.0_next-0.noarch.rpm。
2)下面是我使用的配置:
/opt/fiware-orion-pep/config.js
var config = {};
config.resource = {
original: {
host: 'localhost',
port: 10026
},
proxy: {
port: 1026,
adminPort: 11211
} };
config.authentication = {
checkHeaders: false,
module: 'keystone',
user: '<##################>',
password: '<###################>',
domainName: 'admin_domain',
retries: 3,
cacheTTLs: {
users: 1000,
projectIds: 1000,
roles: 60
},
options: { protocol: 'http',
host: 'cloud.lab.fiware.org',
port: 4730,
path: '/v3/role_assignments',
authPath: '/v3/auth/tokens'
} };
config.ssl = {
active: false,
keyFile: '',
certFile: '' }
config.logLevel = 'DEBUG'; // List of component
config.middlewares = {
require: 'lib/plugins/orionPlugin',
functions: [
'extractCBAction'
] };
config.componentName = 'orion';
config.resourceNamePrefix = 'fiware:';
config.bypass = false;
config.bypassRoleId = '';
module.exports = config;/etc/sysconfig/pepProxy
# General Configuration
############################################################################
# Port where the proxy will listen for requests
PROXY_PORT=1026
# User to execute the PEP Proxy with
PROXY_USER=pepproxy
# Host where the target Context Broker is located
# TARGET_HOST=localhost
# Port where the target Context Broker is listening
# TARGET_PORT=10026
# Maximum level of logs to show (FATAL, ERROR, WARNING, INFO, DEBUG)
LOG_LEVEL=DEBUG
# Indicates what component plugin should be loaded with this PEP: orion, keypass, perseo
COMPONENT_PLUGIN=orion
#
# Access Control Configuration
############################################################################
# Host where the Access Control (the component who knows the policies for the incoming requests) is located
# ACCESS_HOST=
# Port where the Access Control is listening
# ACCESS_PORT=
# Host where the authentication authority for the Access Control is located
# AUTHENTICATION_HOST=
# Port where the authentication authority is listening
# AUTHENTICATION_PORT=
# User name of the PEP Proxy in the authentication authority
PROXY_USERNAME=XXXXXXXXXXXXX
# Password of the PEP Proxy in the Authentication authority
PROXY_PASSWORD=XXXXXXXXXXXXX在上面的文件中,我尝试了以下参数:
Keystone实例: account.lab.fiware.org或cloud.lab.fiware.org
用户: pep或pepProxy或“fiware帐户的用户”
pep或pepProxy或“帐户中的用户密码”
港口: 4730,4731,5000
结果和以前一样..。telefonicaid/fiware-orion-pep无法验证:
log file at /var/log/pepProxy/pepProxy
time=2015-04-13T14:49:24.718Z | lvl=ERROR | corr=71a34c8b-10b3-40a3-be85-71bd3ce34c8a | trans=71a34c8b-10b3-40a3-be85-71bd3ce34c8a | op=/v1/updateContext | msg=VALIDATION-GEN-003] Error connecting to Keystone authentication: KEYSTONE_AUTHENTICATION_ERROR: There was a connection error while authenticating to Keystone: 500
time=2015-04-13T14:49:24.721Z | lvl=DEBUG | corr=71a34c8b-10b3-40a3-be85-71bd3ce34c8a | trans=71a34c8b-10b3-40a3-be85-71bd3ce34c8a | op=/v1/updateContext | msg=response-time: 50745 statusCode: 500来自客户端控制台的结果。
{
"message": "There was a connection error while authenticating to Keystone: 500",
"name": "KEYSTONE_AUTHENTICATION_ERROR"
}我在做错事??
https://stackoverflow.com/questions/29561163
复制相似问题