How to add logout feature to an OpenID enabled site?

后端 未结 9 1719
情书的邮戳
情书的邮戳 2020-12-14 07:36

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

相关标签:
9条回答
  • 2020-12-14 08:21

    You can only implement local logout for OpenID. As Charles Duffy said you can always use specific urls but that is provided the user is using a provider that you know the logout url for. That can be fustrating if your user discover that all his google accounts are logged out when they logout of your website.

    The other way of looking at the problem is whether you want to ensure the the person logging into your website always needs to key in his password, instead of just logging in when he is already logged in to an openid provider.

    This (IMHO) provides better security if they are using it from a public terminal. This will ensure that the user who is logging in always needs to revalidate his password.

    To do that its actually quite simple, just use the PAPE extention openid.ns.pape = "http://specs.openid.net/extensions/pape/1.0".
    openid.pape.max_auth_age = 0

    as part of the URL when you are logging into a OpenID provider.

    More information here http://code.google.com/apis/accounts/docs/OpenID.html

    0 讨论(0)
  • 2020-12-14 08:22

    Below is one trick by which i can logout from Google:

    <iframe id="myIFrame" src="" style='display:none;' > 
     function logOutGoogle(){
         document.getElementById('myIFrame').src='https://www.google.com/accounts/Logout';
         timeOut();
     }
    
    0 讨论(0)
  • 2020-12-14 08:28

    Just destroy the session.

    0 讨论(0)
提交回复
热议问题