Get auth token for accesing Orion FI-LAB instance

二次信任 提交于 2019-12-24 09:52:04

问题


i'm trying to make a request to orion broker using REST Client, for example a NGSI10 queryContext with a payload like this one:

{
  "entities": [
    {
      "type": "*",
      "isPattern": "false",
      "id": "Sevilla:01727449"
     }
  ]

}

and I always receive the same result:

Auth-token not found in request header

The orion context broker that i´m using is fi-ware lab context broker and I want to know how to make a authorized request to this CB using REST Client, if it is possible.

Thanks


回答1:


The Orion instance at FI-LAB uses OAuth authentication. Thus, you need to include a valid X-Auth-Token HTTP header in your requests to Orion.

Your application should implement OAuth and negotiate with the security framework a valid token for that. However, for debug or quick testing you can use the following shell script in order to get a fresh X-Auth-Token:

https://github.com/fgalan/oauth2-example-orion-client/blob/master/token_script.sh

The script will ask you your FI-LAB user and password.

Please, have a look to https://wiki.fi-ware.org/Publish/Subscribe_Broker_-_Orion_Context_Broker_-_User_and_Programmers_Guide#FI-LAB_context_management_platform to get more detail on Orion FI-LAB deployment.

EDIT: the recently published Orion Quick Start guide also includes an example on how to use the token_script.sh script that can be useful.



来源:https://stackoverflow.com/questions/23604495/get-auth-token-for-accesing-orion-fi-lab-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!