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

[fiware-stackoverflow] FIWARE: token_script error parsing json response

    Details

      Description

      Created question in FIWARE Q/A platform on 12-05-2015 at 16:05
      Please, ANSWER this question AT https://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
        3h 1 Backlog Manager 04/Jun/17 9:04 PM
        In Progress In Progress Answered Answered
        2h 59m 1 Backlog Manager 05/Jun/17 12:04 AM
        Answered Answered Closed Closed
        3h 1 Backlog Manager 05/Jun/17 3:04 AM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        HD-Enabler Orion [ 10875 ]
        Description
        Created question in FIWARE Q/A platform on 12-05-2015 at 16:05
        {color: red}Please, ANSWER this question AT{color} https://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
        Created question in FIWARE Q/A platform on 12-05-2015 at 16:05
        {color: red}Please, ANSWER this question AT{color} https://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
        fla Fernando Lopez made changes -
        Assignee Backlog Manager [ backlogmanager ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-06-05 03:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-06-05 03:05|UPDATED status: transition Finish| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-06-05 00:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-06-05 00:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-06-04 21:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-06-04 21:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-06-04 18:05|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2017-06-04 18:05|CREATED monitor | # answers= 1, accepted answer= True
        backlogmanager Backlog Manager created issue -

          People

          • Assignee:
            backlogmanager Backlog Manager
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: