Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fiware orion Orion上下文代理全局实例令牌_Fiware Orion - Fatal编程技术网

Fiware orion Orion上下文代理全局实例令牌

Fiware orion Orion上下文代理全局实例令牌,fiware-orion,Fiware Orion,我想在Orion context broker全局实例上发布一些数据,我已经请求了一个令牌,如中所述。第二天,当我继续编码(java客户端)时,我得到了: Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Unexpected end of file from server at com.sun.jersey.client.urlconnec

我想在Orion context broker全局实例上发布一些数据,我已经请求了一个令牌,如中所述。第二天,当我继续编码(java客户端)时,我得到了:

Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Unexpected end of file from server
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:155)
at com.sun.jersey.api.client.Client.handle(Client.java:652)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:509)
at publishers.fiware.OrionClient.getEntities(OrionClient.java:23)
at FiwareTest.main(FiwareTest.java:11)
Caused by: java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:792)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:789)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1536)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:253)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:153)
... 6 more
所以我申请了一个新的代币,然后再次工作

以这种方式生成的令牌有过期时间吗?多少钱


我有办法获得一个不过期的令牌吗?

根据OpenStack Keystone默认配置,令牌在1小时后过期:

您可以通过获得另一个续订:


我已成功续订,但仅在向有效负载添加用户名和密码之后:
# Amount of time a token should remain valid (in seconds).
# (integer value)
#expiration=3600
POST /v3/auth/tokens HTTP/1.1
Host: test.ttcloud.net:5001
Content-Type: application/json
X-Auth-Token: {{user-token}}
{
 "auth": {
    "identity": {
        "methods": [
            "token"
        ],
        "token": {
            "id": "{{user-token}}"
        }
    }
 }
}