I am following the Fiware context broker introduction to get a token: https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_Quick_Start_for_Programmers
I got the script:
$ wget --no-check-certificate https://raw.githubusercontent.com/fgalan/oauth2-example-orion-client/master/token_script.sh
and I run it as explained:
$ bash token_script.sh
username: [my valid fiware email account]
password: [my valid fiware account password]
But it does not returns any access token. Actually, it does not return anything, no organization, no id, no name.... (I have an organization)
I am running the script in a Fiware cloud instance (Ubuntu 14.04)
UPDATED:
here the verbose from running the script as requested:
root@ubuntu:~# bash -x token_script.sh + echo ''
+ read -p 'Username: ' USER
Username: vicens@datalook.io
+ read -s -p 'Password: ' PASSWORD
Password: + echo ''
++ curl -s -d '{"auth": {"passwordCredentials": {"username":"vicens@datalook.io", "password”:”xxxxxxxx”}}}’ '-HContent- type: application/json' http://cloud.lab.fi-ware.org:4730/v2.0/tokens
+ RESP=
++ sed 's/{"access":{"token":{.*"id":"\(.*\)"},"user.*$/\1/g'
++ echo
+ TOKEN=
+ echo -e '\nAccess Token: '
Access Token:
++ curl -s '-Hx-auth-token: ' http://cloud.lab.fi- ware.org:4730/v2.0/tenants
+ ORGS=
+ echo -e '\nOrganizations: '
Organizations:
+ set ORGS2=
+ awk -v k=text '{printf("%-32s %s \n", "ID", "Name"); n=split($0,a," [{}]"); for (i=1; i<=n; i++) {m=split(a[i], b, "[,:\"]"); if (m>=15) printf("%-32s %s \n", b[9], b[15])}}'
+ echo
ID Name
+ echo ''
+ read -p 'Select an organization from the list above (ID): ' ORG
Select an organization from the list above (ID):
+ BODY='{"auth": {"token":{"id": ""}, "tenantId": ""}}'
++ curl -s -X POST -H 'Content-Type: application/json' -d '{"auth": {"token":{"id": ""}, "tenantId": ""}}' http://cloud.lab.fi-ware.org:4730/v2.0/tokens
+ RESP1=
++ sed 's/{"access":{"token":{.*"id":"\(.*\)","tenant.*$/\1/g'
++ echo
+ TOKEN=
+ echo -e '\nToken: '
Token:
+ echo ''
Cheers, Vicens.
bash -x token_script.sh
, next update your question to include the exact output you get, please? Thanks! – fgalan****
in the output when editing your post). – fgalan