开发者

Get the name of the openid provider

开发者 https://www.devze.com 2023-02-01 13:59 出处:网络
Using OpenID for authentication. How do I get the name of the openid provider once the user is logged in?

Using OpenID for authentication. How do I get the name of the openid provider once the user is logged in?

The aim would be to pop up a relevant message with the name of the openid provider when the开发者_开发问答 user clicks logout. e.g, "Please logout of your google account" if the user is logged in using google as the openid provider.

I was planning to use request.getHeader("Referer");every time a page is loaded and if it contains claimid = google.com then I would set a cookie with the value googleauth. Is that the right way to go. Any other way I could get the auth provider from userservice?


google.appengine.api.users.User object has federated_provider method that returns the URL of OpenID provider which was used to authenticate the user. You could use a mapping of this URLs (e.g. using this table) to user-friendly names such as "Google Accounts".

0

精彩评论

暂无评论...
验证码 换一张
取 消