Hello,
I am working on a Spring Boot application to integrate with your service. While I have had the account for 10 years, I havent put much effort into growing this business. My goal for 2020 is to build a enterprise grade site to integrate with resellerspanel and in 2021 to actually start building the brand. Having said that I am currently working on the login feature of my service. I will essentially be using your login form (since I dont see any option in the API) to validate my clients. However they will will be redirected to one of my portals if they are validated instead of directly to their control panel. Within my portal they will have a link to their control panel. My code will be something like the following in my controller:
@PostMapping("/login")
public void login(@ModelAttribute("userLogin") UserLogin userLogin, HttpServletResponse response) throws IOException {
//TODO: remove localhost and make variable
String responseUrl = URLEncoder.encode("http://localhost:8080", StandardCharsets.UTF_8.toString());
String url = "https://cloudlogin.co/login/?username=" + userLogin.getUsername()
+ "&password="+ userLogin.getPassword() + "&returnURL=" + responseUrl;
ResponseEntity<String> responseEntity = resellersPanel.postForEntity(url ,null ,String.class);
if(null!= responseEntity.getHeaders().getLocation() && responseEntity.getStatusCodeValue() == 302) {
response.sendRedirect(responseEntity.getHeaders(). getLocation().toString() + "&returnURL=" + responseUrl);
}
}
Because I am coding it this way there are some concerns I have.
1. Since the login attempts will be coming from my server's IP's, are there any limits on the login attempts from a particular IP? If so I will have to scrap this whole approach.
2. If my post fails, it simply returns the HTML for the login.bestpaidhosting.com site, without any info like invalid login or anything, Is there a way to get an actual message back instead of the html? If so is this documented anywhere?
Thanks in advance,
Brian
I am working on a Spring Boot application to integrate with your service. While I have had the account for 10 years, I havent put much effort into growing this business. My goal for 2020 is to build a enterprise grade site to integrate with resellerspanel and in 2021 to actually start building the brand. Having said that I am currently working on the login feature of my service. I will essentially be using your login form (since I dont see any option in the API) to validate my clients. However they will will be redirected to one of my portals if they are validated instead of directly to their control panel. Within my portal they will have a link to their control panel. My code will be something like the following in my controller:
@PostMapping("/login")
public void login(@ModelAttribute("userLogin") UserLogin userLogin, HttpServletResponse response) throws IOException {
//TODO: remove localhost and make variable
String responseUrl = URLEncoder.encode("http://localhost:8080", StandardCharsets.UTF_8.toString());
String url = "https://cloudlogin.co/login/?username=" + userLogin.getUsername()
+ "&password="+ userLogin.getPassword() + "&returnURL=" + responseUrl;
ResponseEntity<String> responseEntity = resellersPanel.postForEntity(url ,null ,String.class);
if(null!= responseEntity.getHeaders().getLocation() && responseEntity.getStatusCodeValue() == 302) {
response.sendRedirect(responseEntity.getHeaders(). getLocation().toString() + "&returnURL=" + responseUrl);
}
}
Because I am coding it this way there are some concerns I have.
1. Since the login attempts will be coming from my server's IP's, are there any limits on the login attempts from a particular IP? If so I will have to scrap this whole approach.
2. If my post fails, it simply returns the HTML for the login.bestpaidhosting.com site, without any info like invalid login or anything, Is there a way to get an actual message back instead of the html? If so is this documented anywhere?
Thanks in advance,
Brian
Comment