Solved

Implementing SOAP based OpenID in PHP

Posted on 2010-11-08
6
438 Views
Last Modified: 2012-06-21
Hello.  This is my first question on this forum.

I need to find a good PHP library for implementing SOAP based OpenID.  Preferably this will be with an object oriented design using classes.  And part of the definition of "good" is that this library is supported on an ongoing basis.

Does anyone out here have experience with any of the available libraries and have any recommendations?

Thanks!
0
Comment
Question by:Russ_Kauk
  • 3
  • 3
6 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 34136993
Personally, I avoid SOAP whenever I can.  A RESTful interface is always preferable, for a variety of reasons.  But that said, you might find some good examples in the Google Code library.  Some of the results of this search could be helpful, too.
http://lmgtfy.com?q=OpenID+PHP+SOAP
0
 

Author Comment

by:Russ_Kauk
ID: 34137710
Ray,

Thanks for your comment.  Having spent a considerable amount of time developing a SOAP interface for my customer to a legacy database via that products API, I'm hesitant to jump in right now and learn yet another new software technology - I am not conversant with the RESTful interface.

The customer desires to develop an OpenID login that utilizes their corporate headquarters as the ID service provider.  As happens sometimes, this project is somewhat underfunded so my preference was to stay with that with which I am already familiar.

I've checked out the list of PHP based OpenID solutions at http://wiki.openid.net/w/page/12995176/Libraries.  Since there are already a number of available options, I was hoping to short-cut my own ramp up time and utilize the expertise within this group to determine which of these solutions have been used, if any are SOAP based, how well they are written and supported, etc.

I will, however, check out your suggestion to look at any Google libraries.

~ Russ
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 34138386
Good luck with it.  You can find some pretty good examples of how REST works just about anywhere.  The client-server implementation that powers the WWW is a RESTful design.  The reason it is so popular is that there is almost nothing to learn!  This article tells much more than you need to know to use it.
http://en.wikipedia.org/wiki/Representational_State_Transfer

To show you how easy it is to use the REST design pattern, consider the code snippet.  It is a complete implementation of a RESTful interface.  Put that behind HTTPS and your API key will be safe.

This might be a useful place to get information and share ideas.
http://openid.net/developers/dev-mailing-lists/

Of those things listed for PHP, my instincts would lead me away from PHPClasses and toward these:
http://framework.zend.com/manual/en/zend.openid.html
http://www.janrain.com/openid-enabled

This appears to be fairly new, but there have been a lot of downloads and no outstanding bug reports.  Has a good list of dependencies:
http://pear.php.net/package/OpenID/

You might also want to follow this guy's work, or at least waste a moment on the very enjoyable video mashup halfway down the page.
http://staynalive.com/
<?php // RAY_REST_get_last_name.php

error_reporting(E_ALL);







// DEMONSTRATE HOW A RESTFUL WEB SERVICE WORKS

// INPUT FIRST NAME, OUTPUT LAST NAME

// CALLING EXAMPLE:

// file_get_contents('http://laprbass.com/RAY_REST_get_last_name.php?key=ABC&resp=XML&name=Ray');







// OUR DATA MODEL CONTAINS ALL THE ANSWERS - THIS COULD BE A DATA BASE - AS SIMPLE OR COMPLEX AS NEEDED

$dataModel

= array

( 'Brian'   => 'Portlock'

, 'Ray'     => 'Paseur'

, 'Richard' => 'Quadling'

, 'Dave'    => 'Baldwin'

)

;





// SHOULD RESPONSE BE PLAIN TEXT OR XML FORMAT

$alpha = '';

$omega = '';

if ( (isset($_GET["resp"])) && ($_GET["resp"] == 'XML') )

{

    $alpha = '<response>';

    $omega = '</response>';

}







// TEST THE API KEY

$key = FALSE;



// IF THE URL CONTAINS THE KEY

if (isset($_GET["key"])) $key = $_GET["key"];



// IF THE KEY FAILS TO MATCH OUR OUR REQUIRED 'ABC'

if ($key !== 'ABC') die($alpha . 'BOGUS API KEY' . $omega);







// LOOK UP THE LAST NAME

$name="?";



// IF THE URL CONTAINS THE FIRST NAME

if (isset($_GET["name"])) $name = $_GET["name"];



// IF THE URL NAME IS FOUND IN THE DATA MODEL

if (array_key_exists($name, $dataModel))

{

    // RETURNS THE LAST NAME FROM THE DATA MODEL

    die($alpha . "$dataModel[$name]" . $omega);

}



// RETURNS THE UNKNOWN NAME INDICATOR

else die($alpha . 'UNKNOWN' . $omega);

Open in new window

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Accepted Solution

by:
Russ_Kauk earned 0 total points
ID: 34234976
It appears that I am not going to get any further responses on this question.

To be fair, Ray did provide some good information on REST and some additional suggestions regarding where to research SOAP.

But, on the other hand, I needed specifically some information on existing PHP SOAP based SSO libraries from anyone who had used them and could give me some good advice one direction or another based on their practical experience and to that end I did not receive an answer here.

I was hoping to avoid what is going to be many hours of research and learning time on an already tight project budget and, again, did not receive any information here that will short circuit that process.

Thanks to all who read through the question and good luck to anyone else who may stumble upon this needing similar information!
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 34235471
Best of luck, Russ.  Your experience with SOAP is exactly why knowledgeable professionals avoid SOAP.
0
 

Author Closing Comment

by:Russ_Kauk
ID: 34272865
Although somewhat interesting, the information provided in posts other than mine did not answer my original question - thus it would be inappropriate to recognize those posts as a solution.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now