Home » Php » php – OpenID for dummies?

php – OpenID for dummies?

Posted by: admin July 12, 2020 Leave a comment

Questions:

I’m thinking about adding an openid widget to a toolkit I’m developing.

An important part of that is keeping the UI as simple as possible – although there’s lots of openid tools available they mostly rely on providing a text input box to enter a URL – however as demonstrated here on SO – there are a lot of openID providers which use a generic URL as the endpoint – so it’s simply a matter of clicking on a button/image. I want to provide this service. Indeed, I want to provide the facility to restrict the providers to an approved list.

(I’ve got openIds from various providers – but do not have a clue what the URLs are – that doesn’t prevent me from using sites like this which provide clickable sign-ins!)

Unfortunately Valdimir’s openid class, Janrains PHP OpenID libs, Dope OpenId, and LightOpenId just provide the text box.

Is there a directory of openID provider URLs anywhere? With redistributable graphics?

I did find IDselector.com (where you need an OpenId to access most of the site – but they do not implement their widget on their own site!!!!) but its not very clear what the licensing is.

Are there other/newer libs I should be aware of? This S.O. post is nearly 3 years old!

TIA

C.

How to&Answers:

Some more selectors:

My personal favorite is openid-realselector (demo).

Answer:

The open-id-selector project provides a jQuery-based method of generating a simple form for selecting an Open ID providor. It comes with several common OpenID providors and the appropriate icons.

See a non-functional demo here.

Note that this is only part of the solution; you must still implement OpenID authentication on the server-side, as well, and configure open-id-selector to leverage it (by directing the form to the appropriate path).

Answer:

Integrate WebFinger, so you just have to offer an email input field.