• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call PHP methods from Java

 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I hope i will get the answer of my question here, I have a web application in java. And the other application i have is in PHP. PHP application does the job of Authentication from a authentication server based on username and password. Now I want the same PHP authentication methods from my java application when any user enter in java application.

For this I need to call the PHP functions from Java application, Kindly tell me the possible ways to acheive the solution

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just use Java-based authentication? Building a Rube Goldberg machine to invoke php to do something that's just as easy to do in Java sounds like a less than stellar idea.
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Why not just use Java-based authentication? Building a Rube Goldberg machine to invoke php to do something that's just as easy to do in Java sounds like a less than stellar idea.


I think i missed something, Actually my requirement was little different. I have two applications, one in Java with tomcat session managment and other one in PHP using prado framework for session managment. Now to implement single sign on. I need to pass session information somehow to PHP application if someone enters in Java application and moves to PHP application from there.

I hope i am able to explain the requirement this time.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, you didn't mention that these apps need to cooperate. Can you not simply issue requests from the Java app to the php app that performs the sign on?
 
Sunil Kumar Gupta
Ranch Hand
Posts: 824
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Ah, you didn't mention that these apps need to cooperate. Can you not simply issue requests from the Java app to the php app that performs the sign on?


I am sorry, but i am not getting your point, Can you explain it a little.

Also passing the user information through URL is not appropriate.Another way is web service.

Any other good way?

Thanks for replying so early Bear.
[ January 07, 2008: Message edited by: Sunil Kumar Gupta ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this not all protected by SSL? If so, you can easily mimic a post to the other app securely.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic