我在NodeJs API应用程序中使用jsonwebtoken来验证我的API应用程序中的用户.我设置的流程如下:
1)用户通过注册API注册,并使用以下内容生成访问令牌:
var jwt = require('jsonwebtoken');
var token = jwt.sign(user, _conf.authentication.superSecret, {
expiresIn: 1440 // I intend to keep it short.
});
Run Code Online (Sandbox Code Playgroud)
2)例如,令牌在24小时后到期.此令牌将返回到客户端移动应用程序,以在所有后续API请求中用作标头.
我想知道如何使用jwt的刷新令牌.目前我没有刷新令牌的机制.因此,如果令牌在24小时后到期,我希望客户端(移动应用程序)能够请求新的访问令牌.提前致谢.
我正在尝试使用npm模块soap在节点js中构建soap webservice 。我正在使用提到的soap.listen函数来启动节点js中的soap服务器。我包含的wsdl文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="wscalc1" targetNamespace="http://localhost:8100/api/orderStatusWsdl" xmlns="http://localhost:8100/api/orderStatusWsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<wsdl:message name="receiveOrderStatusRequest">
<wsdl:part name="a" type="xs:string"/>
<wsdl:part name="b" type="xs:string"/>
</wsdl:message>
<wsdl:message name="receiveOrderStatusResponse">
<wsdl:part name="orderStatusResponse" type="xs:string"/>
</wsdl:message>
<wsdl:portType name="orderStatusPort">
<wsdl:operation name="receiveOrderStatus">
<wsdl:input message="receiveOrderStatusRequest"/>
<wsdl:output message="receiveOrderStatusResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="orderStatusBinding" type="orderStatusPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="receiveOrderStatus">
<soap:operation soapAction="receiveOrderStatus"/>
<wsdl:input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="orderStatusService">
<wsdl:port binding="orderStatusBinding" name="orderStatus">
<soap:address location="http://localhost:8100/api/orderStatusWsdl"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Run Code Online (Sandbox Code Playgroud)
节点js代码:
var orderStatusWsdlXml = fs.readFileSync(path.join(__dirname, 'soap/wsdl/myWsdl2.wsdl'), 'utf8') …Run Code Online (Sandbox Code Playgroud) 我试图使用以下命令从我的远程Redis数据库中删除多个密钥.
redis-cli -h <host> -p 6379 KEYS "myprefix:*" | xargs redis-cli -h <host> -p 6379 DEL
Run Code Online (Sandbox Code Playgroud)
它删除了除了包含空格的键之外的所有匹配键.
例如
删除:
未删除:
什么应该是我的查询模式,以便这些也被删除?我试过谷歌搜索,但无法找到任何解决方案.