|
@@ -14,8 +14,16 @@
|
|
|
|
|
|
<h2>短信认证</h2>
|
|
|
|
|
|
+配置maxkey中maxkey.properties
|
|
|
+
|
|
|
+<pre><code class="ini hljs">
|
|
|
+config.login.mfa=true
|
|
|
+#TimeBasedOtpAuthn MailOtpAuthn SmsOtpAuthnYunxin SmsOtpAuthnAliyun SmsOtpAuthnTencentCloud
|
|
|
+config.login.mfa.type=TimeBasedOtpAuthn
|
|
|
+</code></pre>
|
|
|
+
|
|
|
<h3>腾讯云短信</h3>
|
|
|
-配置maxkey中spring/maxkey-security.xml
|
|
|
+配置maxkey中maxkey.properties
|
|
|
secretId 账号Appkey
|
|
|
|
|
|
secretKey 密钥appSecret
|
|
@@ -26,23 +34,15 @@ templateId 短信模板ID
|
|
|
|
|
|
sign 签名
|
|
|
|
|
|
-<pre><code class="xml hljs">
|
|
|
-<!--
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.TimeBasedOtpAuthn">
|
|
|
-</bean>
|
|
|
--->
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.sms.SmsOtpAuthnTencentCloud">
|
|
|
- <property name="secretId" value="94395d754eb55693043f5d6a2b772ef4" />
|
|
|
- <property name="secretKey" value="05d5485357bc" />
|
|
|
- <property name="smsSdkAppid" value="1486220095" />
|
|
|
- <property name="templateId" value="14860095" />
|
|
|
- <property name="sign" value="1486009522" />
|
|
|
-</bean>
|
|
|
-
|
|
|
+<pre><code class="ini hljs">
|
|
|
+config.otp.sms.aliyun.accesskeyid=94395d754eb55693043f5d6a2b772ef4
|
|
|
+config.otp.sms.aliyun.accesssecret=05d5485357bc
|
|
|
+config.otp.sms.aliyun.templatecode=14860095
|
|
|
+config.otp.sms.aliyun.signname=maxkey
|
|
|
</code></pre>
|
|
|
|
|
|
<h3>阿里云短信</h3>
|
|
|
-配置maxkey中spring/maxkey-security.xml
|
|
|
+配置maxkey中maxkey.properties
|
|
|
|
|
|
accessKeyId 账号Appkey
|
|
|
|
|
@@ -52,22 +52,16 @@ templateCode 短信模板ID
|
|
|
|
|
|
signName 签名
|
|
|
|
|
|
-<pre><code class="xml hljs">
|
|
|
-<!--
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.TimeBasedOtpAuthn">
|
|
|
-</bean>
|
|
|
--->
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.sms.SmsOtpAuthnAliyun">
|
|
|
- <property name="accessKeyId" value="94395d754eb55693043f5d6a2b772ef3" />
|
|
|
- <property name="accessSecret" value="05d5485357bc" />
|
|
|
- <property name="templateCode" value="SMS_187590021" />
|
|
|
- <property name="signName" value="MaxKey" />
|
|
|
-</bean>
|
|
|
-
|
|
|
+<pre><code class="ini hljs">
|
|
|
+config.otp.sms.tencentcloud.secretid=94395d754eb55693043f5d6a2b772ef4
|
|
|
+config.otp.sms.tencentcloud.secretkey=05d5485357bc
|
|
|
+config.otp.sms.tencentcloud.smssdkappid=1486220095
|
|
|
+config.otp.sms.tencentcloud.templateid=14860095
|
|
|
+config.otp.sms.tencentcloud.sign=1486009522
|
|
|
</code></pre>
|
|
|
|
|
|
<h3>网易云信</h3>
|
|
|
-配置maxkey中spring/maxkey-security.xml
|
|
|
+配置maxkey中maxkey.properties
|
|
|
|
|
|
appKey 网易云信分配的账号Appkey
|
|
|
|
|
@@ -75,17 +69,10 @@ appSecret 网易云信分配的密钥appSecret
|
|
|
|
|
|
templateId 短信模板ID
|
|
|
|
|
|
-<pre><code class="xml hljs">
|
|
|
-<!--
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.TimeBasedOtpAuthn">
|
|
|
-</bean>
|
|
|
--->
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.sms.SmsOtpAuthnYunxin">
|
|
|
- <property name="appKey" value="94395d754eb55693043f5d6a2b772ef4" />
|
|
|
- <property name="appSecret" value="05d5485357bc" />
|
|
|
- <property name="templateId" value="14860095" />
|
|
|
-</bean>
|
|
|
-
|
|
|
+<pre><code class="ini hljs">
|
|
|
+config.otp.sms.yunxin.appkey=94395d754eb55693043f5d6a2b772ef4
|
|
|
+config.otp.sms.yunxin.appsecret=05d5485357bc
|
|
|
+config.otp.sms.yunxin.templateid=14860095
|
|
|
</code></pre>
|
|
|
|
|
|
<h2>电子邮件</h2>
|
|
@@ -93,31 +80,27 @@ templateId 短信模板ID
|
|
|
配置邮箱地址
|
|
|
|
|
|
文件
|
|
|
-maxkey/config/applicationConfig.properties
|
|
|
+maxkey/application.properties
|
|
|
|
|
|
<pre><code class="ini hljs">
|
|
|
# EMAIL configuration
|
|
|
-config.email.username=maxkey@163.com
|
|
|
-config.email.password=password
|
|
|
-config.email.smtpHost=smtp.163.com
|
|
|
-config.email.port=465
|
|
|
-config.email.senderMail=maxkey@163.com
|
|
|
-config.email.ssl=true
|
|
|
+spring.mail.default-encoding=utf-8
|
|
|
+spring.mail.host=smtp.163.com
|
|
|
+spring.mail.port=465
|
|
|
+spring.mail.username=maxkey@163.com
|
|
|
+spring.mail.password=password
|
|
|
+spring.mail.protocol=smtp
|
|
|
+spring.mail.properties.ssl=true
|
|
|
+spring.mail.properties.sender=maxkey@163.com
|
|
|
</code></pre>
|
|
|
|
|
|
-配置maxkey中spring/maxkey-security.xml
|
|
|
+配置maxkey中application.properties
|
|
|
|
|
|
subject 邮件主题
|
|
|
|
|
|
messageTemplate 邮件内容模板,请勿修改参数{0}为用户名,{1}认证码,{2}有效间隔
|
|
|
|
|
|
-<pre><code class="xml hljs">
|
|
|
-<!--
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.TimeBasedOtpAuthn">
|
|
|
-</bean>
|
|
|
--->
|
|
|
-<bean id="tfaOptAuthn" class="org.maxkey.crypto.password.opt.impl.MailOtpAuthn">
|
|
|
- <property name="subject" value="MaxKey One Time PassWord" />
|
|
|
- <property name="messageTemplate" value="{0} You Token is {1} , it validity in {2} minutes." />
|
|
|
-</bean>
|
|
|
+<pre><code class="ini hljs">
|
|
|
+spring.mail.properties.mailotp.message.subject=MaxKey One Time PassWord
|
|
|
+spring.mail.properties.mailotp.message.template={0} You Token is {1} , it validity in {2} minutes.
|
|
|
</code></pre>
|