FIWARE: token_script json error recognition error

I am trying to create an access code using a script

https://raw.githubusercontent.com/fgalan/oauth2-example-orion-client/master/token_script.sh

I believe the json response has changed and the sed pattern no longer works.

How can I create a valid access token?

Json answer:

{
"access": {
    "token": {
        "issued_at": "2015-05-12T14:29:03.523315",
        "expires": "2015-05-12T15:29:03Z",
        "id": "?????",
        "audit_ids": [
            "????"
        ]
    },
    "serviceCatalog": [],
    "user": {
        "username": "pedro@viur.pt",
        "roles_links": [],
        "id": "pedro-almeida",
        "roles": [],
        "name": "pedro@viur.pt"
    },
    "metadata": {
        "is_admin": 0,
        "roles": []
    }
}

}

which generates a token

TOKEN=`echo $RESP | sed "s/{\"access\":{\"token\":{.*\"id\":\"\(.*\)\"},\"user.*$/\1/g"`

I tried using access: token: id, but it does not work. The new identifier is also shorter than the old ones.

thank

+4
source share
1 answer

This problem was caused by the migration of IdM to the FIWARE Lab in early May 2015. After it was known, the PEP on orion.lag.fiware.org and the token generation script were fixed.

, token_script.sh . .

+2

All Articles