LoginConfig.java 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Copyright [2020] [MaxKey of copyright http://www.maxkey.top]
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.maxkey.configuration;
  17. import org.maxkey.constants.ConstantsProperties;
  18. import org.springframework.beans.factory.annotation.Value;
  19. import org.springframework.context.annotation.Configuration;
  20. import org.springframework.context.annotation.PropertySource;
  21. @Configuration
  22. @PropertySource(ConstantsProperties.maxKeyPropertySource)
  23. public class LoginConfig {
  24. @Value("${config.login.captcha}")
  25. boolean captcha;
  26. //验证码类型 text 文本 , arithmetic算术验证码
  27. @Value("${config.login.captcha.type:text}")
  28. String captchaType;
  29. @Value("${config.login.mfa}")
  30. boolean mfa;
  31. @Value("${config.login.socialsignon}")
  32. boolean socialSignOn;
  33. @Value("${config.login.kerberos}")
  34. boolean kerberos;
  35. @Value("${config.login.remeberme}")
  36. boolean remeberMe;
  37. @Value("${config.login.wsfederation}")
  38. boolean wsFederation;
  39. @Value("${config.login.default.uri}")
  40. String defaultUri;
  41. /**
  42. * .
  43. */
  44. public LoginConfig() {
  45. // TODO Auto-generated constructor stub
  46. }
  47. public boolean isCaptcha() {
  48. return captcha;
  49. }
  50. public void setCaptcha(boolean captcha) {
  51. this.captcha = captcha;
  52. }
  53. public boolean isSocialSignOn() {
  54. return socialSignOn;
  55. }
  56. public void setSocialSignOn(boolean socialSignOn) {
  57. this.socialSignOn = socialSignOn;
  58. }
  59. public boolean isKerberos() {
  60. return kerberos;
  61. }
  62. public void setKerberos(boolean kerberos) {
  63. this.kerberos = kerberos;
  64. }
  65. public boolean isMfa() {
  66. return mfa;
  67. }
  68. public void setMfa(boolean mfa) {
  69. this.mfa = mfa;
  70. }
  71. public String getDefaultUri() {
  72. return defaultUri;
  73. }
  74. public void setDefaultUri(String defaultUri) {
  75. this.defaultUri = defaultUri;
  76. }
  77. public boolean isRemeberMe() {
  78. return remeberMe;
  79. }
  80. public void setRemeberMe(boolean remeberMe) {
  81. this.remeberMe = remeberMe;
  82. }
  83. public boolean isWsFederation() {
  84. return wsFederation;
  85. }
  86. public void setWsFederation(boolean wsFederation) {
  87. this.wsFederation = wsFederation;
  88. }
  89. public String getCaptchaType() {
  90. return captchaType;
  91. }
  92. public void setCaptchaType(String captchaType) {
  93. this.captchaType = captchaType;
  94. }
  95. @Override
  96. public String toString() {
  97. StringBuilder builder = new StringBuilder();
  98. builder.append("LoginConfig [captcha=");
  99. builder.append(captcha);
  100. builder.append(", captchaType=");
  101. builder.append(captchaType);
  102. builder.append(", mfa=");
  103. builder.append(mfa);
  104. builder.append(", socialSignOn=");
  105. builder.append(socialSignOn);
  106. builder.append(", kerberos=");
  107. builder.append(kerberos);
  108. builder.append(", remeberMe=");
  109. builder.append(remeberMe);
  110. builder.append(", wsFederation=");
  111. builder.append(wsFederation);
  112. builder.append(", defaultUri=");
  113. builder.append(defaultUri);
  114. builder.append("]");
  115. return builder.toString();
  116. }
  117. }