| | |
| | | import com.pollex.pam.security.token.EServiceAuthenticationToken; |
| | | import com.pollex.pam.service.LoginRecordService; |
| | | import com.pollex.pam.service.dto.EServiceResponse; |
| | | import com.pollex.pam.web.rest.errors.EServiceErrorException; |
| | | import org.apache.http.conn.ssl.NoopHostnameVerifier; |
| | | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | |
| | | } |
| | | else { |
| | | loginRecordService.saveEServiceLoginFailRecord(account, eServiceResponse.getMsg()); |
| | | throw new RuntimeException("eService login failed, eService response code = " + eServiceResponse.getCode() + ", eService response msg = " + eServiceResponse.getMsg()); |
| | | throw new EServiceErrorException(eServiceResponse.getMsg()); |
| | | } |
| | | } |
| | | |
| | | throw new RuntimeException("eService http error!, response http status code = " + responseEntity.getStatusCode()); |
| | | } catch (JsonProcessingException e) { |
| | | throw new AuthenticationServiceException("convert to json processing error!"); |
| | | throw new RuntimeException("convert to json processing error!"); |
| | | } catch (GeneralSecurityException e) { |
| | | throw new AuthenticationServiceException("General Security SSL error!"); |
| | | throw new RuntimeException("General Security SSL error!"); |
| | | } |
| | | } |
| | | |