我在我的機器上安裝了Orion Context Broker和pep代理。我針對的是keyRock的全局實例和AuthZforce來驗證上下文代理。任何人都可以通過PeP代理解釋Context Broker的用法嗎?
這裏是我的config.js:
var config = {};
config.pep_port = 1307;
// 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.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 = '1026';
config.username = '<my fiware lab username>';
config.password = '<my fiware lab pass>';
// in seconds
config.chache_time = 300;
// if enabled PEP checks permissions with AuthZForce GE.
// only compatible with oauth2 tokens engine
config.azf = {
enabled: false,
host: 'auth.lab.fiware.org',
port: 6019,
path: '/authzforce/domains/d698df7f-ffd4-11e4-a09d-ed06f24e1e78/pdp'
};
// list of paths that will not check authentication/authorization
// example: ['/public/*', '/static/css/']
config.public_paths = [];
// options: oauth2/keystone
config.tokens_engine = 'oauth2';
config.magic_key = undefined;
module.exports = config;
當我做node server.js
我順利拿到:
Starting PEP proxy in port 1307. Keystone authentication ...
Success authenticating PEP proxy. Proxy Auth-token: e2189bdc1a8b4aae9280b0fd5a6ae8a0
下面這個installation and administration guide我做了如下命令:
捲曲 - 頭「X-Auth-Token:e2189bdc1a8b4aae9280b0fd5a6ae8a0」http://localhost:1307
從那裏我得到這個消息:
[TOKEN] Checking token with IDM...
User access-token not authorized
我很認真地在這裏損失,不知道通過這三個中介如何訪問上下文經紀人?
誰的主人我應該問一個令牌?
我不知道我是否在問正確的問題。所有這一切的關鍵是確保對上下文代理的訪問。
編輯1
建立auth-token.sh後,我得到了以下錯誤:
<orionError>
<code>400</code>
<reasonPhrase>Bad Request</reasonPhrase>
<details>service not found</details>
</orionError>
節點server.js報道這樣的:
Starting PEP proxy in port 1307. Keystone authentication ...
Success authenticating PEP proxy. Proxy Auth-token: b90604bc94134c1a81414e97a23196f3
[TOKEN] Checking token with IDM...
[ROOT] Access-token OK. Redirecting to app...
以前的命令:sh auth-token.sh <username> <pass>
給了我:
X-Auth-Token for '<my email on fiware lab>': OxFTGtMM6ckBa7FQCUmwvvhj6GQYFc
然後我只是curl --header "X-Auth-Token:OxFTGtMM6ckBa7FQCUmwvvhj6GQYFc" http://localhost:1307
哪給了我之前提到的錯誤。
我還有一個問題,只是更新了我的問題,請查找編輯1。請記住,我加倍檢查並且上下文代理確實在運行。 – Vrankela