Ning Developer Network

This content has been moved to the documentation wiki. Please click here to access the latest, most up to date version.

Hello Everyone!

I know that some of you have been eager to integrate your social network’s existing member base with external applications such as your blog. Your wait is now over! We’ve released some APIs that will allow you to authenticate your members on an external website.

We’ve written a rough example that integrates a social network powered by Ning with a WordPress blog. The code is a bit longer than most of our how-tos, so I’ve attached it as a zip file for easier reading and hacking.

The attached zip file contains three files:

  • Readme.txt: a repeat of the installation instructions and a list of some known issues
  • ningid.php: The wordpress plugin which will rewrite your comments form to request a Ning ID email address and password
  • ning-auth.php: The file that hits our APIs and authenticates your members against your social network. The rewritten comments form will actually post comments here as an intermediate step in the normal comment submission process

To install this plugin please follow these steps:

  1. Open each of the two php files included in the zip file with a text editor and update the configuration fields at the top of each with the information from your social network and blog
  2. Copy the entire directory from the zip file into your /wp-content/plugins directory

Please keep in mind that this is a developer example. It has not been tested in depth and there are some known issues. For example, if you’ve customized your templates, you may need to tweak ningid.php a bit in order to have the modified comment form render correctly.

Happy hacking!
Mike

Update (11/28/2007): If you're not interested in learning about the APIs and really just want to integrate your blog with your WordPress blog, check out this thread which contains a more polished version of this example.

Share

Attachments:

Replies are closed for this discussion.

Replies to This Discussion

Hi Mike, thanks for sharing.
I'm afraid I'm not a very good coder and the few lines I recognize are pretty much in HTML, javascript and ASP rather than PHP.

I'm looking at using ASP code that would retrive user email and password from a non-ning portal and pass it on to ning to enable a single-sign-on solution.

From your example I gather Ning has a page to which one can send an email and a password.
However, I didn't quite get the pure basics of how such a call would look. Could it be the equivalent of a plain POST FORM in HTML?
Also, I assume this works for users who are already registered with Ning. What happens with those who aren't already registered? Would they automatically get signed up (if firstname, lastname is included?) or would a sign-up page be displayed (in which case they would all get the sign-up first time they enter).

If you have a bare bone basic for how a form that POST or use GET to login to Ning would look that would be absolutely fantastic.

Thanks and appreciate your help,
/Lars
Hello Lars!

In this example our authentication uses a REST Web Service with HTTP basic authentication. This means that you could POST this data to a URL, but since it returns XML you'll need to do some processing on the result before displaying it to the user.

This example does not create new memberships so if someone does not yet have an account on your social network, they will not have one automatically created. We're working on an API for this and when it's ready I'll post an example.

Since Ning's social network application is written in PHP, the vast majority of our examples will be in PHP, but I'll investigate writing up some that use static HTML. I won't, however, be able to post one for authentication since this API requires the use of a higher level language. Stay tuned for some other examples, though :)

Cheers!
Mike
Hi Mike-

We are also highly interested in using NING to power out community. We built our app on RAILS and linked in Simple Machine Forums with a simple bridge our programmer created so that registering on Gamehelper.com - authors an account in our DB as well as the SMF DB.

We'd like to be able to pass this information on into NING as well so we can create a transparent experience for our users as they traverse the site.

I'll mark to follow this conversation - please update us once this API is ready so we can do some testing from our end :)

Thanks!

Joe Markert
Editor in Chief
Gamehelper.com
+1 - this would be great. It's really important that we can seamlessly integrate in and out of ning.
I am very interested in a stable bridge to link SMF and Ning.

Our SMF Forum is very healthy and I don't want to jeopardize that by forcing a change.

Currently, SMF is bridged with Joomla and the Joomla site is clumsy for my community members who are not very high level internet users.

I'd like to replace all the Joomla functions with Ning and leave the discussion forum healthy and vibrant.

Please follow up on this and let us know when things develop.

Cheers,
Ron
Has there been any progress on this.
One thing that could be great as a way to create a more flexible and "future proof" way of integrating (and help avoid the trouble of potential duplicates identities being attempted might be to use OpenID (http://openid.net/get/)

This would mean Ning mainly need to worry about integration with OpenID and all of us who want to integrate with Ning and other webtools can focus on creating OpenIDs to be used for Ning and other webtools.

BTW: Wordpress (which you used as an integration example is already part of OpenID)
Cheers,
/Lars
Great feedback and thinking Lars - hopefully this gets some momentum on their end.
Hello Lars,

An API that allows transparent SSO integration of external applications with your social network is still on roadmap but it is not planned for the next few releases.

When it's ready we'll be sure to post a tutorial here, on developer.ning.com.

Cheers!
Mike
Thanks for the heads up Mike - keep up the great work! Happy New Year to you guys :)
Thanks Mike,
I understand priorities need to be made.
In case it could help build a case for it I strongly feel you could exponentially grow your user base by allowing integration this way. My company has 75000 users and even though I don't expect all to join in at once I'm convinced the word would get out pretty quickly and established communities would start using Ning in a more serious way as an integral part of their offerings (which by the way is probably the best way for you guys to create true value and add on services that you can charge for).

Again thanks for the quick respone and great to hear it's in the roadmap.
Cheers,
/Lars
On http://www.ning.com/about/businesses.html it says:

At this time, we can't integrate your registration system into your social network on Ning. We'd love to consider these opportunities, but we can't.

Does this hack actually means that it's possible to integrate MY registration into my ning for biz network?

regards, Vincent
I'd like to add my voice to the chorus of those clamoring for this. If you had this today, I would be doing the happy dance around the office right now, as you would have saved me from having to implement a lot of social networking features into my site.

Some of the features I'd like to see:

1) Create accounts on the network remotely.
2) Log In remotely (so, some kind of single sign on).
3) I'd like to be able to disable account creation on the network, so all account creation is remote.
4) I'd like the "invite friends to join" stuff to still work, so given 3, that invite would have to point at my site.

RSS

© 2009   Created by Ning Developer Admin

Badges  |  Report an Issue  |  Privacy  |  Terms of Service