How to add logout feature to an OpenID enabled site?

Madhu picture Madhu · Dec 28, 2009 · Viewed 15.6k times · Source

I have recently added OpenID login to my website. But I don't know how to add the logout feature.

For example, on clicking the Sign In button I am able to show the login form of the selected OpenID provider, for example Google Account. However, I don't know how to implement a Sign Out button to sign out of the Google Account.

Please advice.

Answer

Charles Duffy picture Charles Duffy · Nov 10, 2010

Individual OpenID providers offer different URLs for logout to which the user can be redirected.

Google: https://www.google.com/accounts/Logout

Yahoo: https://login.yahoo.com/config/login?logout=1

There has been discussion of allowing OPs to provide these URLs as a part of the standard; see this discussion on the OpenID mailing list.