I have 2 applications.. one is my own application developed using JSF.. Another one is a document Repositary fully developed using PHP. Now i need to integrate both..
i dont kno anything abt php..
The problem is the user needs to login inside my jsf application and once he logs in that user imformation should be passed to php page which is responsible for the authentication process so as to check whether the user is valid user for the document repositary.. so the user need not provide his username and password seperately for the document repositary.. is this possible.. can any one help.. the scenario is the person who is authenticated for one particular usergroup of my jsf application will be automatically authenticated for doc rep..for both of these cases i need to understand how to pass value from jsf to php.
Assuming the PHP application is hosted somewhere you can always access the PHP service by submitting a POST HTTP request. Alternatively you can expose the PHP logic as a webservice (may be RESTful) and then invoke that webservice from your JSF application. In either case your PHP application should return some result indicating whether the user credentials are valid or not.
Hi, I dont know anything about webservice.. but i will tell you what idea i have, check whether this is ok... i will start the php server and jboss each time my application starts.. so the doclib is avl for me in xamp.. when user enters the username and password in jsf page i get the values and pass it to the php code where the authentication takes place..
raghavendra bhat wrote:Hi, I dont know anything about webservice.. but i will tell you what idea i have, check whether this is ok... i will start the php server and jboss each time my application starts.. so the doclib is avl for me in xamp.. when user enters the username and password in jsf page i get the values and pass it to the php code where the authentication takes place..
this might work but I am not sure how good the approach is. Are you running them locally? i.e localhost? In anycase you send the data as request parameters to he URL on which your PHP application is running.
Ideally, you would have some sort of SSO (Single Signon) service that both Java and PHP webapps could tap into. Java's built-in security allows for SSO Realms - the CAS system is one such provider and it's almost certainly usable with PHP as well.
Next best would be to implement a custom Realm that authenticated against the PHP system and used the results to construct the UserPrincipal object which anchors a user's identity within the Java webapp.
Worst would be to write a user-defined login process as part of the Java application itself and make it pass on the request using the HttpURLRequest object.
Customer surveys are for companies who didn't pay proper attention to begin with.