2016-10-03 2 views
1

오리온 컨텍스트 브로커 글로벌 인스턴스에 일부 데이터를 게시하고 토큰을 요청했습니다 (Quick start guide). 내가 (자바 클라이언트) 다음 날 코딩을 계속하면 내가 가지고 :오리온 컨텍스트 브로커 글로벌 인스턴스 토큰

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 

그래서 나는 새로운 토큰을 요청하고 다시했다.

이렇게 생성 된 토큰에는 만료 시간이 있습니까? 얼마나?

만료되지 않는 토큰을 얻는 방법이 있습니까?

답변

1

OpenStack은 키스톤 기본 구성에 따르면, 토큰 1 시간 후에 만료 :

http://developer.openstack.org/api-ref/identity/v3/index.html?expanded=#token-authentication-with-unscoped-authorization

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}}" 
     } 
    } 
} 
} 
+0

I :

http://docs.openstack.org/juno/config-reference/content/section_keystone.conf.html

# Amount of time a token should remain valid (in seconds). # (integer value) #expiration=3600 

당신이 다른 하나를 얻어서을 갱신 할 수 있습니다 성공 후 갱신되었지만 광고 후에 만 페이로드에 대한 사용자 이름과 암호 땡기 : –