2010-07-15 24 views

回答

0

轉到相關網站,查看他們的文檔。沒有權威或完整的OP標識符列表。

+0

所以爲了發現開放式ID提供者端點url我必須找到終點URL並存儲在數據庫中或使用if和else。 – 2010-07-17 08:35:54

+0

我不知道你爲什麼要在這裏使用if/else。通常情況下,您根本不存儲這些信息並讓用戶輸入。如果您想爲用戶提供按鈕以使其更容易,則可以爲包含這些OP標識符的按鈕編寫HTML。我從來沒有聽說過將它們包含在數據庫中的理由 - 除非它是一個數據驅動的安全過濾器,只允許只允許經過批准的OP端點。 – 2010-07-17 13:46:51

2

U可以有一個js文件是這樣的.. var defaultProviders = { google: { name: 'Google', url: 'https://www.google.com/accounts/o8/id', hasLargeIcon: true }, yahoo: { name: 'Yahoo', url: 'http://me.yahoo.com/', hasLargeIcon: true }, aol: { name: 'AOL', label: 'Enter your AOL screenname:', url: 'http://openid.aol.com/{username}', hasLargeIcon: true }, myopenid: { name: 'MyOpenID', label: 'Enter your MyOpenID username:', url: 'http://{username}.myopenid.com/', hasLargeIcon: true }, openid: { name: 'OpenID', url: 'http://', hasLargeIcon: true }, livejournal: { name: 'LiveJournal', label: 'Enter your Livejournal username:', url: 'http://{username}.livejournal.com/', hasLargeIcon: false }, wordpress: { name: 'Wordpress', label: 'Enter your Wordpress.com username:', url: 'http://{username}.wordpress.com/', hasLargeIcon: false }, blogger: { name: 'Blogger', label: 'Enter your Blogger account:', url: 'http://{username}.blogspot.com/', hasLargeIcon: false }, verisign: { name: 'Verisign', label: 'Enter your Verisign username:', url: 'http://{username}.pip.verisignlabs.com/', hasLargeIcon: false }, claimid: { name: 'ClaimID', label: 'Enter your ClaimID username:', url: 'http://openid.claimid.com/{username}', hasLargeIcon: false }, clickpass: { name: 'ClickPass', label: 'Enter your ClickPass username:', url: 'http://clickpass.com/public/{username}', hasLargeIcon: false } };

不止一次username可ü可以使用下面的代碼創建完整的URL ... `函數(事件){VAR 取消=真正; var val = $('input [type = text]',username).val();如果(val.length> 0){ var pvd = providers [selectedId];如果(pvd){set_oad(true,true); var url = pvd.url.replace('{username}',val); _setOpenIdUrl(url); _setCookie(selectedId); alert(「URL is:」+ url);
input.get()[0] .form.submit(); } } if(cancel){ event.preventDefault(); }
};' 這將大部分時間工作....