1

I try to protect orion with PEP Wilma 6.2. Although PEP proxy starts, It can't get a 'x-subject-token'. Why can't PEP get it? Is my configuration incorrect or insufficient?

PEP Proxy Wilma 6.2 
server.js:70

IDM.authenticate (function (token) {

    log.info('Success authenticating PEP proxy. Proxy Auth-token: ', token);

}, function (status, e) {

lib/idm.js:22
    var authenticate = function(callback, callbackError) {

        var options = {
            host: config.idm.host,
            port: config.idm.port,
            path: '/v3/auth/tokens',
            method: 'POST',
            headers: {'Content-Type': 'application/json'}
        };

.............................................

        log.info(options); // debug
        log.info(protocol); // debug
        log.info(body.auth.identity.password.user); //debug
        proxy.sendData(protocol, options, JSON.stringify(body), undefined, function (status, resp, headers) {
            my_token = headers['x-subject-token'];
            log.info("my_token:", my_token); //debug
            callback(my_token);
        }, callbackError);

Log : 'my_token' is undefiend.

pep      | 2018-04-12 10:27:44.665  - INFO: Server - Starting PEP proxy in port 80. IdM authentication ...
pep      | 2018-04-12 10:27:44.667  - INFO: IDM-Client - { host: 'account.lab.fiware.org',
pep      |   port: 5000,
pep      |   path: '/v3/auth/tokens',
pep      |   method: 'POST',
pep      |   headers: { 'Content-Type': 'application/json' } }
pep      | 2018-04-12 10:27:44.668  - INFO: IDM-Client - http
pep      | 2018-04-12 10:27:44.668  - INFO: IDM-Client - { name: 'pep_proxy_132e42370ad546a8b85d21dd7453b4ae',
pep      |   password: '9077ddf99863487296a75f1ef8fef297' }
pep      | 2018-04-12 10:27:45.723  - INFO: IDM-Client - my_token: undefined
pep      | 2018-04-12 10:27:45.723  - INFO: Server - Success authenticating PEP proxy. Proxy Auth-token:  undefined

Thank you in advance.

I added below log at 25th April

pep      | 2018-04-25 11:58:26.229  - INFO: Server - Starting PEP proxy in port 80. IdM authentication .        ..
pep      | { host: 'account.lab.fiware.org',
pep      |   port: 5000,
pep      |   path: '/v3/auth/tokens',
pep      |   method: 'POST',
pep      |   headers: { 'Content-Type': 'application/json' } }
pep      | http
pep      | { name: 'pep_proxy_5e45c606882c469aa6413e9993e040**',
pep      |   password: '9c01e49e55434b40a6436aeb61095c**' }
pep      | *** response ***
pep      | status: 0
pep      | resp: Error: connect ECONNREFUSED
pep      |     at errnoException (net.js:905:11)
pep      |     at Object.afterConnect [as oncomplete] (net.js:896:19)
pep      | headers: { '': undefined }
pep      | my_token: undefined
pep      | 2018-04-25 11:58:27.301  - INFO: Server - Success authenticating PEP proxy. Proxy Auth-token:          undefined
fisuda
  • 76
  • 4
  • Which PEP implemention are you using? Wilma or Steelskin? – fgalan Apr 12 '18 at 09:49
  • I'm using Wilma 6.2 at https://github.com/ging/fiware-pep-proxy.git. – fisuda Apr 13 '18 at 02:09
  • How are you getting the OAuth token? Put your code in the question. Also, take a look at [this answer](https://stackoverflow.com/questions/49360026/fiware-how-to-connect-pep-proxy-to-orion-and-configure-both-with-https). I think it should help you. – Dalton Cézane Apr 16 '18 at 16:54
  • it seems the authentication has succeed but you are incorrectly getting the token from the response. Could you take a look to the response body and headers? – Álvaro Alonso Apr 23 '18 at 12:57
  • Thank you for your comment. The response was 'connect ECONNREFUSED'. Please see above log. – fisuda Apr 25 '18 at 03:22

0 Answers0