usos login fix - deploy
This commit is contained in:
parent
f61eda3990
commit
b9c9cfee6f
|
@ -22,6 +22,12 @@ public class PropertiesLoader {
|
|||
@Value("${application.secret}")
|
||||
private String secret;
|
||||
|
||||
@Value("${server.address}")
|
||||
private String serverAddress;
|
||||
|
||||
@Value("${server.port}")
|
||||
private String serverPort;
|
||||
|
||||
public void initUsosInstance() {
|
||||
RestAssured.baseURI = usosBaseURI;
|
||||
RestAssured.basePath = usosBasePath;
|
||||
|
@ -40,4 +46,11 @@ public class PropertiesLoader {
|
|||
return secret;
|
||||
}
|
||||
|
||||
public String getServerAddress() {
|
||||
return serverAddress;
|
||||
}
|
||||
|
||||
public String getServerPort() {
|
||||
return serverPort;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ public class AuthorizationService {
|
|||
private static final String ENC = "UTF-8";
|
||||
private static final String HMAC_SHA1 = "HmacSHA1";
|
||||
private static Base64 base64 = new Base64();
|
||||
|
||||
@Autowired
|
||||
private PropertiesLoader propertiesLoader;
|
||||
|
||||
|
@ -201,7 +202,7 @@ public class AuthorizationService {
|
|||
|
||||
private String getAuthToken(String username, String password) throws IOException {
|
||||
HttpClient httpClient = HttpClientBuilder.create().build();
|
||||
HttpPost request = new HttpPost("http://localhost:8080/login");
|
||||
HttpPost request = new HttpPost("http://" + propertiesLoader.getServerAddress() + ":" + propertiesLoader.getServerPort()+ "/login");
|
||||
StringEntity params = new StringEntity("{\"username\":\"" + username + "\",\"password\":\"" + password + "\"} ");
|
||||
request.addHeader("content-type", "application/json");
|
||||
request.setEntity(params);
|
||||
|
|
|
@ -6,7 +6,10 @@ spring.datasource.password=L0XIcnvtWpYEnr4w
|
|||
spring.servlet.multipart.max-file-size=500KB
|
||||
spring.servlet.multipart.max-request-size=500KB
|
||||
|
||||
#server.address=51.75.30.146
|
||||
server.address=51.75.30.146
|
||||
server.port=8080
|
||||
|
||||
#server.address=localhost
|
||||
#server.port=8080
|
||||
|
||||
#usos instance to use
|
||||
|
|
Loading…
Reference in New Issue