Hello K. Tsang,
You are very welcome. Thank you very much for your quick reply, I really appreciate that.
I am going to explain clearly my problem. I have 2 servers:
ServerA = Java / JSP page (Tomcat) --> my Java application
ServerB = PHP (Apache) --> 3rd party application, which is mibew messenger
What I am trying to do is that when I am logged from my java application(
http://localhost:8084/myTest/), I need to post the formlogin and password to mibew (Server B)
http://localhost:9090/mibew/index.php/operator and use my form to connect to mibew.
so the goal is I want to be automatically connected to mibew when I loggue from my application(so I want to wrokaround mibew form)
Mibew has MVC architecture and uses route system (I am trying to understand how it works)
On mibew side, there is a config file called, and here is the content:
## Home
home:
path: /
defaults:
_controller: Mibew\Controller\HomeController::redirectAction
home_operator:
path: /operator
defaults:
_controller: Mibew\Controller\HomeController::dashboardAction
_access_check: Mibew\AccessControl\Check\LoggedInCheck
## Log in
login:
path: /operator/login
defaults:
_controller: Mibew\Controller\LoginController::showFormAction
methods: [GET]
login_submit:
path: /operator/login
defaults:
_controller: Mibew\Controller\LoginController::submitFormAction
methods: [POST]
This my form:
<form name="loginForm" action="http://localhost:9090/mibew/index.php/operator" method="post">
<input type="text" name="formlogin" size="25" class="field-input" value="formlogin"/>
<input type="password" name="password" size="25" value="" class="field-input" autocomplete="off"/><br/><br/></td>
<input type="submit" value="Enter" name="submit" id="submit" class="submit-button-background login-button"/></td>
So when you submit the authetification form on mibew side, the main controller is "HomeController.php". This one redirects client's browser to operator's home page ("home_operator"):
public function redirectAction(Request $request)
{
return $this->redirect($this->generateUrl('home_operator'));
}
It executes HomeController.dashboardAction
method. This method renders the operator's home page and also has an access check, to check if the operator is connected or not.
showFormAction: is a method that allows to build the form on mibew side
submitFormAction: is the action form for mibew.
So here is my problem: when I submit my form, I am forwarded by default to mibew authetification form, which is I think normal
because it seems like there is an access check and if you are not loggued from mibew authentification, you are forwarded by default to mibew login form.
I tried to check the value of formlogin and password by doing $_POST["formlogin"] and $_POST["password"] on mibew side, and I realized that my data are not posted.
My goal is to bypass mibew authetification by using my java web application form and connect to operator home page "http://localhost:9090/mibew/index.php/operator" once I am connected.
Please let me know if you can give some idea, I really appreciate that.
Thank you very much