1
Social Business Toolkit을 사용하여 OAuth를 사용하여 SmartCloud에 액세스하려하지만이 오류가 발생합니다. SmartCloudBasicEndpoint
을 사용하면 모든 것이 잘 동작합니다.OAuth를 사용하여 SmartCloud에 액세스하는 중 오류가 발생했습니다.
[4/4/14 12:01:56:236 CEST] 00000038 SBTProxy I URL computed from SBTProxy is https://apps.na.collabserv.com/communities/service/atom/oauth/communities/all
[4/4/14 12:01:56:556 CEST] 00000038 E com.ibm.sbt.security.authentication.oauth.consumer.OAuth1Handler _performOAuth1Dance Failed to get request token. requestUrl:https://apps.na.collabserv.com/manage/oauth/getRequestToken, authorizeUrl: https://apps.na.collabserv.com/manage/oauth/authorizeToken, accessUrl: https://apps.na.collabserv.com/manage/oauth/getAccessToken, callback: null, truncated key:a919....1b25, truncated secret:9054....687d. OAuth callback is empty, please check with your application vendor to ensure a callback is not required.
com.ibm.sbt.security.authentication.oauth.OAuthException: Internal error - getRequestToken failed Exception: <br>
at com.ibm.sbt.security.authentication.oauth.consumer.OAuth1Handler.getRequestTokenFromServer(OAuth1Handler.java:169)
at com.ibm.sbt.security.authentication.oauth.consumer.OAuth1Handler._performOAuth1Dance(OAuth1Handler.java:656)
at com.ibm.sbt.security.authentication.oauth.consumer.OAuth1Handler.performOAuth1Dance(OAuth1Handler.java:649)
at com.ibm.sbt.security.authentication.oauth.consumer.OAuth1Handler._acquireToken(OAuth1Handler.java:625)
at com.ibm.sbt.security.authentication.oauth.consumer.OAuth1Handler.acquireToken(OAuth1Handler.java:580)
at com.ibm.sbt.services.endpoints.OAuthEndpoint.authenticate(OAuthEndpoint.java:234)
at com.ibm.sbt.services.client.ClientService.forceAuthentication(ClientService.java:281)
at com.ibm.sbt.services.client.ClientService.processResponse(ClientService.java:1123)
at com.ibm.sbt.services.client.ClientService._xhr(ClientService.java:1041)
at com.ibm.sbt.services.client.ClientService.execRequest(ClientService.java:1006)
at com.ibm.sbt.services.client.ClientService.xhr(ClientService.java:966)
at com.ibm.sbt.services.client.ClientService.get(ClientService.java:842)
at com.ibm.sbt.services.client.ClientService.get(ClientService.java:838)
at com.ibm.sbt.services.client.base.BaseService.retrieveData(BaseService.java:352)
at com.ibm.sbt.services.client.base.BaseService.retrieveData(BaseService.java:376)
at com.ibm.sbt.services.client.base.BaseService.retrieveData(BaseService.java:327)
at com.ibm.sbt.services.client.base.BaseService.getEntities(BaseService.java:187)
at com.ibm.sbt.services.client.connections.communities.CommunityService.getPublicCommunities(CommunityService.java:164)
at com.ibm.sbt.services.client.connections.communities.CommunityService.getPublicCommunities(CommunityService.java:146)
at servlets.SmartCloudTestServlet.doGet(SmartCloudTestServlet.java:82)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:575)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1224)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97)
at com.ibm.sbt.util.SBTFilter.doFilter(SBTFilter.java:53)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:928)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1025)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3751)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:962)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1690)
Caused by: java.lang.NullPointerException
at java.net.URLEncoder.encode(URLEncoder.java:197)
at com.ibm.sbt.security.authentication.oauth.consumer.OAuth1Handler.getRequestTokenFromServer(OAuth1Handler.java:156)
... 51 more
[4/4/14 12:01:56:560 CEST] 00000038 SystemOut O Problem Occurred while fetching public communities: Problem occurred while fetching public communities
는 여기에 지금까지 한 일이다 :
- 새로운 서블릿 응용 프로그램을 만듭니다.
- 나는
RuntimeFactoryStandalone
을 사용하고 있습니다. managed-beans.xml
및sbt.properties
(둘 다 샘플 app에서)을/WEB-INF/
에 추가했습니다.- WebSphere Application Server에서 응용 프로그램을 실행 중입니다. (WebSphere Portal의 포틀릿에서 동일한 코드를 시도했습니다.)
- 등록 정보 파일에 SmartCloud 키, secret 및 appId가 추가되었습니다.
이 코드를 사용하고 있습니다 :
try {
CommunityService svc = new CommunityService("smartcloud");
CommunityList communities = svc.getPublicCommunities();
System.out.println("Listing public communities , Total communities found : " + communities.getTotalResults());
} catch (Throwable e) {
System.out.println("Problem Occurred while fetching public communities: " + e.getMessage());
//e.printStackTrace();
}
을 내가 수동으로 SmartCloudOAuthEndpoint
를 사용하는 경우 나 같은 오류를 받고 있어요.
여기를 잊어 버렸습니까?
내 매뉴얼 엔드 포인트 :
SmartCloudOAuthEndpoint endpoint = new SmartCloudOAuthEndpoint();
endpoint.setUrl("https://apps.na.collabserv.com");
endpoint.setConsumerKey("a91..----REMOVED FOR STACKOVERFLOW----..");
endpoint.setConsumerSecret("905..----REMOVED FOR STACKOVERFLOW----..");
endpoint.setRequestTokenURL("https://apps.na.collabserv.com/manage/oauth/getRequestToken");
endpoint.setAuthorizationURL("https://apps.na.collabserv.com/manage/oauth/authorizeToken");
endpoint.setAccessTokenURL("https://apps.na.collabserv.com/manage/oauth/getAccessToken");
endpoint.setAppId("RonnieTest");
endpoint.setApiVersion("apiVersion");
//endpoint.setHttpProxy("localhost:8888");
endpoint.setForceTrustSSLCertificate(true);
endpoint.setSignatureMethod("PLAINTEXT");
endpoint.setCredentialStore("SmartCloudStore");
endpoint.setAuthenticationService("communities/service/atom/communities/my");
것은 내가 SmartCloud이 내부 응용 프로그램을 사용하고는 :
OAuth 콜백이 비어 있으므로 애플리케이션 공급 업체에 문의하여 콜백이 필요하지 않은지 확인하십시오. - 오류입니다. 콜백이 전달되지 않는 것처럼 보입니다. 팀에보고하겠습니다. –
OAuth2 키를 사용 했습니까? 또는 OAuth 키? 그게 당신이 바로 열쇠를 복사 볼 수있는 이중 확인 가치가있을 수도 –
빠른 답장을 다시 보내 주셔서 감사합니다. 내 질문을 편집하고 추가 정보를 추가했습니다. 'setForceTrustSSLCertificate'가이 문제의 원인이 될 수 있습니까? – magnetronnie