-WSO2 IoT Server 3.1.0 RC- 我配置了ip,创建了证书,启动了代理服务器,然后是核心。核心给出错误,我错过了什么?
[IoT-Core]错误 - {org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler}签名或消息身份验证无效。 线程“Thread-31”中的异常java.lang.NullPointerException 在org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor.apply(OAuthRequestInterceptor.java:104) 在feign.SynchronousMethodHandler.targetRequest(SynchronousMethodHandler.java:158) at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:88) at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76) 在feign.ReflectiveFeign $ FeignInvocationHandler.invoke(ReflectiveFeign.java:103) 在com.sun.proxy。$ Proxy40.apisGet(未知来源) at org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl.publishAPI(APIPublisherServiceImpl.java:53) 在org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler.publishAPIs(APIPublisherStartupHandler.java:97) 在org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler.access $ 500(APIPublisherStartupHandler.java:30) 在org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler $ 1.run(APIPublisherStartupHandler.java:69) 在java.lang.Thread.run(Thread.java:748)
答案 0 :(得分:3)
这是因为为了发布API,IoT核心使用JWT授权类型。为此,请求标头必须使用iot核心服务器的公共证书进行签名。因此,您需要将密钥库的公共证书添加到身份提供者。为此,请按照以下步骤操作。
keytool -export -alias wso2carbon -rfc -keystore wso2carbon.jks -file server.pem -storepass wso2carbon
内部运行以下命令。server.pem
,删除BEGIN CERTIFICATE
和END CERTIFICATE
行以及新行。<IoTs-Home>/conf/identity/identity-provider/iot-default.xml
元素下的<Certificate>
。答案 1 :(得分:0)
我在WSO2 IoT 3.3.0中遇到类似的问题:
1.我在exemple.com上运行./change-ip.sh
2.我创建了一个新的密钥库(exemple.com.jks)with signed certificate
3.我按照here中所述的步骤将默认密钥库更改为新的密钥库exemple.com.jks
4.启用线和伪装的调试模式。
5.启动./iot-server.sh start
6.打开https://exemple.com:9443/devicemgt门户
7.输入管理员用户帐户,并显示如下错误:
TID: [-1] [] [2018-09-02 16:58:34,015] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2
TID: [-1234] [] [2018-09-02 16:58:34,021] ERROR {auth-module} - An exception thrown when executing the script '/app/modules/login.js'. {auth-module}
TID: [-1234] [] [2018-09-02 16:58:34,025] ERROR {auth-module} - org.wso2.carbon.apimgt.integration.client.exception.APIMClientOAuthException: Failed to retrieve scopes from access token {auth-module}
org.mozilla.javascript.WrappedException: Wrapped org.wso2.carbon.apimgt.integration.client.exception.APIMClientOAuthException: Failed to retrieve scopes from access token (/devicemgt/app/modules/login.js#31)
完整stacketrace:
TID: [-1] [] [2018-09-02 16:56:21,061] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "POST /token?tenantDomain=carbon.super HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,064] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "Authorization: Basic Z1UxanlPOUxvS3JlWGFYb1V2c1NqWTc1VkdBYTpKU1kxc0R...NWkt4ZmdFSmNh[\r] [\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,064] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "Content-Type: application/x-www-form-urlencoded[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,064] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "Content-Length: 826[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,064] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "Host: wazidmg.cf:8243[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,064] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "Connection: Keep-Alive[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,065] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,065] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "Accept-Encoding: gzip,deflate[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,065] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,065] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 >> "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6WyJkZXZpY2VtZ3QiXSwibmJmIjoxNTM1OTA3Mzgws_eitWu0w30lyqZGU9P79f5y-FRIYkTOuWs-MVckTqpuktzdt51uNfB7iJygFNmDHMXTDQRQZJ4D9vWy0tRx1O_nU8rdBtcn8e-SP0zJTEvAEXST__lJHinNVeq1op2SqLSciP-jfvlFZo8ooF0KRqvhqsyX2Je3MDnLir8O22pv3PW3-Ttz-yHOxQpeSXw5RrPAILjWkLPDqqx9XrEtgqJBrSH115TumNiyvoGPaLpa67jddIfFy70wjIBYGkSqRYGtWOWLz3q2wC5QNrK02wCCJhLf9nM60mjhDeoAo6pVjI4xnpacTOnkDJ8WLnBkhNNvTNRD-88x2p1LYVvDww&scope=apim%3Aapi_create+apim%3Aapi_view+apim%3Aapi_publish+apim%3Asubscribe+apim%3Atier_view+apim%3Atier_manage+apim%3Asubscription_view+apim%3Asubscription_block" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,284] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 > "HTTP/1.1 400 Bad Request[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,693] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "X-Frame-Options: DENY[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,693] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "X-Content-Type-Options: nosniff[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,693] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "X-XSS-Protection: 1; mode=block[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,694] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "Date: Sun, 02 Sep 2018 16:56:21 GMT[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,694] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "Content-Type: application/json[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,694] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "Content-Length: 92[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,694] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "Connection: close[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,694] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "Server: WSO2 Carbon Server[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,694] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,694] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-1 >> "{"error_description":"Signature or Message Authentication invalid.","error":"invalid_grant"}" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:56:21,738] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-1 > "POST /token?tenantDomain=carbon.super HTTP/1.1[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "Authorization: Basic Z1UxanlPOUxvS3JlWGFYb1V2c1NqWTc1VkdBYTpKU1kxc0RwVXNmblpETERvTE9NWkt4ZmdFSmNh[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "Content-Type: application/x-www-form-urlencoded[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "Content-Length: 828[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "Host: wazidmg.cf:8243[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "Connection: Keep-Alive[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "User-Agent: Apache-HttpClient/4.3.6 (java 1.5)[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "Accept-Encoding: gzip,deflate[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,932] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2 >> "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImF1ZCI6WyJkZXZpY2VtZ3QiXSwibmJmIjoxNTM1OTA3NTEzLCJVc2VybmFtZSI6ImFkbWluIiwiaXNzIjoid3NvMi5vcmdcL3Byb2R1Y3RzXC9pb3QiLCJleHAiOjE1MzU5Njc1MTMsImlhdCI6MTUzNTkwNzUxMywianRpIjoiMTUzNTkwNzUxMzg5NjE0MTk3NTMwMDYifQ.iD7Uu-leHyi-ya1PG8V_AiMN-n-HAi037afm_utsKewe1er2hdPeEegJ0zetLFNGpPjw0D7ye5IJrdSQr7zi5RXC2-DD2nZlGPK9KPP5K2_9t050oOAPIKcnQftt8B6aagGLhVsEKsMz10xaGj3G5IVn1Rc4nz114R2CeYtTa4_DRlfrVePf6KqvXRpPRYrpJ642x7jScjcfWn4x6MePF9Qr9-_k5UYp03mZcgJIkdlBd1plRzt5pTvHNATDxcEJcw4HLMVJMSOfbWSqpsUbZr6n0g6zd0fslgee7T8d-QcbTnhdwnxoLJyJkVVytskpSHXcNgfGM6UG-IIBx7EWSA&scope=apim%3Aapi_create+apim%3Aapi_view+apim%3Aapi_publish+apim%3Asubscribe+apim%3Atier_view+apim%3Atier_manage+apim%3Asubscription_view+apim%3Asubscription_block" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,961] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 > "HTTP/1.1 400 Bad Request[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,994] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Frame-Options: DENY[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "X-Content-Type-Options: nosniff[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "X-XSS-Protection: 1; mode=block[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "Date: Sun, 02 Sep 2018 16:58:33 GMT[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "Content-Type: application/json[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "Content-Length: 92[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "Connection: close[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "Server: WSO2 Carbon Server[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:33,995] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Sender I/O dispatcher-2 >> "{"error_description":"Signature or Message Authentication invalid.","error":"invalid_grant"}" {org.apache.synapse.transport.http.wire} TID: [-1] [] [2018-09-02 16:58:34,014] DEBUG {org.apache.synapse.transport.http.wire} - HTTPS-Listener I/O dispatcher-2
我不知道我错过了什么...