Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-4383

FIWARE.Question.Tech.Data.OrionContextBroker.Token_ScriptErrorParsingJsonResponse

    Details

      Description

      Created question in FIWARE Q/A platform on 12-05-2015 at 16:05
      Please, ANSWER this question AT http://stackoverflow.com/questions/30193763/fiware-token-script-error-parsing-json-response

      Question:
      FIWARE: token_script error parsing json response

      Description:
      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

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        1s 1 Backlog Manager 25/Sep/15 12:40 PM
        In Progress In Progress Answered Answered
        2d 21h 50m 1 Backlog Manager 28/Sep/15 10:31 AM
        Answered Answered Closed Closed
        4m 11s 1 Backlog Manager 28/Sep/15 10:35 AM

          People

          • Assignee:
            fermin Fermín Galán
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: