4
votes

I am trying to generate an access code using the script

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

I believe the response json has changed and the sed pattern is not working anymore.

How can I generate a valid access token?

Json response:

{
"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": []
    }
}

}

line that generates the token

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

I have tried to use the access:token:id returned but it does not work. The new id is also shorter then the old ones

Thanks

1
Hi @UlTriX, it would improve your question (and make it easier to answer) if you included the relevant code directly in your question --- highlighting what the current problems are.DilithiumMatrix
thank you for the heads up. it is now editedUlTriX

1 Answers

2
votes

This problem was caused by the IdM migration at FIWARE Lab in early May 2015. After be aware of it, the PEP at orion.lag.fiware.org and token generation script have been fixed.

Please, donwload again the token_script.sh file and try again. It should work.