[UPDATE] 解決弱點Se: Incorrect definition of Serializable class
[UPDATE] 解決弱點Information exposure to log file
[UPDATE] 解決弱點Use of hard-coded password
| | |
| | | private SendEmailProperties email; |
| | | private String fileFolderPath; |
| | | private String aesKey; |
| | | private String defaultPaxxword; |
| | | |
| | | public boolean isMockLogin() { |
| | | return mockLogin; |
| | |
| | | this.aesKey = aesKey; |
| | | } |
| | | |
| | | @Override |
| | | public String getDefaultPaxxword() { |
| | | return defaultPaxxword; |
| | | } |
| | | |
| | | public void setDefaultPaxxword(String defaultPaxxword) { |
| | | this.defaultPaxxword = defaultPaxxword; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import com.pollex.pam.business.config.AppProperties; |
| | | import com.pollex.pam.business.domain.TokenBlackList; |
| | | import com.pollex.pam.business.repository.TokenBlackListRepository; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | TokenBlackListRepository tokenBlackListRepository; |
| | | |
| | | @Autowired |
| | | AppProperties applicationProperties; |
| | | |
| | | public TokenProvider(JHipsterProperties jHipsterProperties) { |
| | | byte[] keyBytes; |
| | |
| | | .filter(auth -> !auth.trim().isEmpty()) |
| | | .map(SimpleGrantedAuthority::new) |
| | | .collect(Collectors.toList()); |
| | | |
| | | User principal = new User(claims.getSubject(), "", authorities); |
| | | System.out.println("applicationProperties.getDefaultPaxxword()+++++++++++===="+applicationProperties.getDefaultPaxxword()); |
| | | User principal = new User(claims.getSubject(), applicationProperties.getDefaultPaxxword(), authorities); |
| | | UsernamePasswordAuthenticationToken authInfo = new UsernamePasswordAuthenticationToken(principal, token, authorities); |
| | | authInfo.setDetails(claims.get(AUTHORITIES_DETAILS)); |
| | | |
| | |
| | | |
| | | private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID; |
| | | |
| | | private final OtpAccount principle; |
| | | private transient OtpAccount principle; |
| | | private String credentials; |
| | | |
| | | public OtpAuthenticationToken(OtpAccount principle, String credentials) { |
| | |
| | | |
| | | public OtpResponseDTO sendByPhone(String phone) { |
| | | OtpWeb otpWS = getOtpWebService(); |
| | | log.debug("call OtpService sendOtpBySMS, url = {}, systemType = {}, service password = {}, phone = {}", |
| | | applicationProperty.getOtpWebServiceUrl(), applicationProperty.getOtpWebServiceSystemType(), applicationProperty.getOtpWebServicePassword(), phone); |
| | | // log.debug("call OtpService sendOtpBySMS, url = {}, systemType = {}, service password = {}, phone = {}", |
| | | // applicationProperty.getOtpWebServiceUrl(), applicationProperty.getOtpWebServiceSystemType(), applicationProperty.getOtpWebServicePassword(), phone); |
| | | |
| | | StringArray result = |
| | | otpWS.sendOtpBySMS(applicationProperty.getOtpWebServicePassword(), applicationProperty.getOtpWebServiceSystemType(), phone); |
| | |
| | | |
| | | public OtpResponseDTO verifyOTP(String indexKey, String otpCode) { |
| | | OtpWeb otpWS = getOtpWebService(); |
| | | log.debug("call OtpService verifyOTP, url = {}, systemType = {}, service password = {}, indexKey = {}, otpCode = {}", |
| | | applicationProperty.getOtpWebServiceUrl(), applicationProperty.getOtpWebServiceSystemType(), applicationProperty.getOtpWebServicePassword(), indexKey, otpCode); |
| | | // log.debug("call OtpService verifyOTP, url = {}, systemType = {}, service password = {}, indexKey = {}, otpCode = {}", |
| | | // applicationProperty.getOtpWebServiceUrl(), applicationProperty.getOtpWebServiceSystemType(), applicationProperty.getOtpWebServicePassword(), indexKey, otpCode); |
| | | |
| | | StringArray result = |
| | | otpWS.verifyOtp(applicationProperty.getOtpWebServicePassword(), applicationProperty.getOtpWebServiceSystemType(), indexKey, otpCode); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@code GET /authenticate} : check if the user is authenticated, and return its login. |
| | | * |
| | | * @param request the HTTP request. |
| | | * @return the login if the user is authenticated. |
| | | */ |
| | | @GetMapping("/authenticate") |
| | | public String isAuthenticated(HttpServletRequest request) { |
| | | log.debug("REST request to check if the current user is authenticated"); |
| | | return request.getRemoteUser(); |
| | | } |
| | | // /** |
| | | // * {@code GET /authenticate} : check if the user is authenticated, and return its login. |
| | | // * |
| | | // * @param request the HTTP request. |
| | | // * @return the login if the user is authenticated. |
| | | // */ |
| | | // @GetMapping("/authenticate") |
| | | // public String isAuthenticated(HttpServletRequest request) { |
| | | // log.debug("REST request to check if the current user is authenticated"); |
| | | // return request.getRemoteUser(); |
| | | // } |
| | | |
| | | /** |
| | | * {@code GET /account} : get the current user. |
| | |
| | | method: 'POLLEX_GMAIL' |
| | | file-folder-path: C://pam_file |
| | | aes-key: PAMKEY1234567890 |
| | | default-paxxword: |
| | |
| | | method: 'POLLEX_GMAIL' |
| | | file-folder-path: C://pam_file |
| | | aes-key: PAMKEY1234567890 |
| | | default-paxxword: |
| | |
| | | method: 'PAM_EMAIL_SERVICE' |
| | | file-folder-path: /sfs_omo/AgentPhoto/ |
| | | aes-key: PAMKEY1234567890 |
| | | default-paxxword: |
| | |
| | | method: 'PAM_EMAIL_SERVICE' |
| | | file-folder-path: /sfs_omo/AgentPhoto/ |
| | | aes-key: PAMKEY1234567890 |
| | | default-paxxword: |
| | |
| | | method: 'PAM_EMAIL_SERVICE' |
| | | file-folder-path: /sfs_omo/AgentPhoto/ |
| | | aes-key: PAMKEY1234567890 |
| | | default-paxxword: |