MobileFirst V8.0 消费者版无法调用适配器过程
Unable to call adapter procedure in MobileFirst V8.0 Consumer Edition
我使用的是 MobileFirst V8.0 消费者版。我已经为我的应用程序设置了一个测试服务器。当我从移动应用程序调用适配器过程(受安全检查保护)时,服务器出现以下错误:
[8/25/16 15:10:08:879 CDT] 0000010b com.ibm.mfp.server.az.internal.ConfidentialClientHelper E Unable to sign access token
com.ibm.mfp.server.security.shared.webtoken.WebTokenException: com.ibm.mfp.server.security.shared.webtoken.WebTokenException: Unsupported credentials type
at com.ibm.mfp.server.security.shared.webtoken.JWS.sign(JWS.java:191)
at com.ibm.mfp.server.az.internal.ConfidentialClientHelper.generateAccessToken(ConfidentialClientHelper.java:94)
at com.ibm.mfp.server.az.internal.token.TokenEndpointImpl.generateTokenResponse(TokenEndpointImpl.java:170)
at com.ibm.mfp.server.az.internal.token.TokenEndpointImpl.serveAuthorizationCodeGrantType(TokenEndpointImpl.java:147)
at com.ibm.mfp.server.az.internal.token.TokenEndpointImpl.getToken(TokenEndpointImpl.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1104)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:912)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.run(DynamicVirtualHost.java:262)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.ibm.mfp.server.security.shared.webtoken.WebTokenException: Unsupported credentials type
at com.ibm.mfp.server.security.shared.webtoken.PKICredentials.getRsaPublicKey(PKICredentials.java:120)
at com.ibm.mfp.server.security.shared.webtoken.PKICredentials.createWebKey(PKICredentials.java:96)
at com.ibm.mfp.server.security.shared.webtoken.PKICredentials.createHeader(PKICredentials.java:48)
at com.ibm.mfp.server.security.shared.webtoken.JWS.sign(JWS.java:186)
... 32 more
此外,我在我的 MFP 服务器实例中使用用户定义的密钥库。
我按照 this 文档中所述,使用带有 -keyalg RSA
选项的以下命令重新生成了密钥库,并重新配置了密钥库,此错误消失了:
keytool -keystore <keystore name> -genkey -alias <alias name> -keylag RSA
之前我参考了 MFP 控制台中名为在 MobileFirst 控制台中从以下位置创建您自己的密钥库的指南 Runtime Settings --> Keystore
并且缺少 -keyalg RSA
选项。
我使用的是 MobileFirst V8.0 消费者版。我已经为我的应用程序设置了一个测试服务器。当我从移动应用程序调用适配器过程(受安全检查保护)时,服务器出现以下错误:
[8/25/16 15:10:08:879 CDT] 0000010b com.ibm.mfp.server.az.internal.ConfidentialClientHelper E Unable to sign access token
com.ibm.mfp.server.security.shared.webtoken.WebTokenException: com.ibm.mfp.server.security.shared.webtoken.WebTokenException: Unsupported credentials type
at com.ibm.mfp.server.security.shared.webtoken.JWS.sign(JWS.java:191)
at com.ibm.mfp.server.az.internal.ConfidentialClientHelper.generateAccessToken(ConfidentialClientHelper.java:94)
at com.ibm.mfp.server.az.internal.token.TokenEndpointImpl.generateTokenResponse(TokenEndpointImpl.java:170)
at com.ibm.mfp.server.az.internal.token.TokenEndpointImpl.serveAuthorizationCodeGrantType(TokenEndpointImpl.java:147)
at com.ibm.mfp.server.az.internal.token.TokenEndpointImpl.getToken(TokenEndpointImpl.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1285)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:776)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:473)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1104)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:81)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:912)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.run(DynamicVirtualHost.java:262)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: com.ibm.mfp.server.security.shared.webtoken.WebTokenException: Unsupported credentials type
at com.ibm.mfp.server.security.shared.webtoken.PKICredentials.getRsaPublicKey(PKICredentials.java:120)
at com.ibm.mfp.server.security.shared.webtoken.PKICredentials.createWebKey(PKICredentials.java:96)
at com.ibm.mfp.server.security.shared.webtoken.PKICredentials.createHeader(PKICredentials.java:48)
at com.ibm.mfp.server.security.shared.webtoken.JWS.sign(JWS.java:186)
... 32 more
此外,我在我的 MFP 服务器实例中使用用户定义的密钥库。
我按照 this 文档中所述,使用带有 -keyalg RSA
选项的以下命令重新生成了密钥库,并重新配置了密钥库,此错误消失了:
keytool -keystore <keystore name> -genkey -alias <alias name> -keylag RSA
之前我参考了 MFP 控制台中名为在 MobileFirst 控制台中从以下位置创建您自己的密钥库的指南 Runtime Settings --> Keystore
并且缺少 -keyalg RSA
选项。