1

I wanted to connect pep-proxy with the idm .. so I followed the installation of pep from that link .. https://github.com/ging/fiware-pep-proxy by building it from the source . That was the config file i was supposed to edit

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

i also wanted to know how could i get both the app_id and the trusted_apps parameters and i'm also confused with the meaning of the app_id whether it's the client id or not .

That was the first part of my issue.

when i put the client id with app id and put the username and password of pep proxy that i got when i registerd it on idm , i got keystone communication error

when i edited the idm host parameter by adding "http" at the beginning , i got no token and i get "token undefined" message . Also when i edited the username and password by putting those of idm account , everytime i get a new token. So i wanted to know the best way to build the fiware pep-proxy and make it communicate correctly with the idm with no problems .

Then i tried to follow the installation commands from the docker file . On building the pep-proxy with these commands , i got a new config file which is that of fiware academia

enter image description here

this config file is different from the first one i worked on . When i followed the steps in this video https://www.youtube.com/watch?v=dtKsjGbJ7Xc&index=10&list=PLARS-yIy9nOoBIOJS05Rpkvu1pZiNTgPT and configured the username and password by putting those of the pep-proxy , i got this error.

enter image description here

On putting "http" before keystone parameter as follows

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

i got this message

enter image description here

But on putting the username and password of idm in the configuration as shown below

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

i always get a new token .

Now , I want to know the best way to get the pep-proxy and the idm work together as i'm still struggling to make them communicate properly.

EDIT: I've deployed both of the latest versions of pep-proxy and idm from these links . https://github.com/ging/fiware-pep-proxy , https://github.com/ging/fiware-idm . I've also configured the pep-proxy as follows

```
// 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;
```

and on starting the idm and pep-proxy , i get a token as shown in the following log 32775470_524428264620979_7740486530111635456_n

and this is the log of the idm

32779988_524428297954309_4770390630587170816_n

and when i test the pep-proxy with the idm by sending a request with the provided token i get an empty reply from server as follows 32764669_524428831287589_4228451219091226624_n

these are also the logs of the pep-proxy after sending the request .

32856053_524428894620916_5143172278388785152_n

Edit: I guess now my token not created successfully or I'm using deprecated API as I'm using Oauth2-client mentioned In fiware academy to generate token https://github.com/ging/oauth2-example-client?files=1

and token generated successfully as shown and token generated successfully as shown

when I click get user information I got the same error appeared when I tried to use this token in pep proxsy appear in Oauth2-client and client has been stopped  I tried to use different way to generate token and how use this token I mean leatest And stable version of document that discribe how play with idm but didn't Find it so I'm asking about how create a valied token And if there is a document compatable with leates version of idm please mention it sorry for inconvenience

Update : I have followed this document "https://www.slideshare.net/mobile/daltoncezane/integrating-fiware-orion-keyrock-and-wilma"to make communication between idm and pep proxsy and specifically this code to generate token from idm send it using 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

but can't generate token This is postman response

DOCTYPE html> Error

SyntaxError: Unexpected token

in JSON at position 0
   at JSON.parse (<anonymous>)
   at createStrictSyntaxError

(/home/ubuntu/fiware-idm/node_modules/body-parser/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/index.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)

and this is logs of idm after sending request

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)           

hope is much clearer and that there's a solution

ahmad emad
  • 172
  • 1
  • 13
  • It seems the problem is with your token, doesn't it? How is the code you are using to make the request? – Dalton Cézane May 22 '18 at 18:08
  • I edit the question with last state – ahmad emad May 23 '18 at 06:10
  • But you still did not provide your code. How are you using the oauth token to make the request? If you put your code and any error message, it is better to get some help. And avoid images... – Dalton Cézane May 23 '18 at 13:47
  • Could you please explain how get code from the oauth-client because I didn't understand what you main with code < https://github.com/ging/oauth2-example-client > – ahmad emad May 23 '18 at 14:14
  • This link points to a README of a github project. In order to get help, you have to inform, in your question, the exact code you are using to do what you want. And inform also some error message. I am supposing what you are trying to do... but it is not clear yet. So, I still do not know if I can help you. – Dalton Cézane May 23 '18 at 14:24
  • Possible duplicate of [Fiware - How to integrate Keyrock IdM, Wilma PEP Proxy and Orion Context Broker?](https://stackoverflow.com/questions/40999447/fiware-how-to-integrate-keyrock-idm-wilma-pep-proxy-and-orion-context-broker) – Dalton Cézane May 23 '18 at 14:26
  • https://www.slideshare.net/mobile/daltoncezane/integrating-fiware-orion-keyrock-and-wilma is this document only 3 pages? – ahmad emad May 25 '18 at 13:00
  • Yes. It contains all information needed. – Dalton Cézane May 25 '18 at 14:53
  • I will catch up steps in this document and I will back soon to discuss results thank you @Dalton – ahmad emad May 25 '18 at 20:00
  • I followed the document and still not working as mention in new edit in question – ahmad emad May 26 '18 at 07:53
  • your question still is not clear. We can not guess what code you are using only seeing the error messages. I suggest you edit your question leaving only what is important to the problem: a brief description, the code used and the error message. Erase all the rest (including the "edits"). The error is informing you have a problem in the JSON. We can not help without see what code you are using. – Dalton Cézane May 28 '18 at 05:23

0 Answers0