12
Google Apps 帳帳 OpenID 帳 Timothy Chien http://blog.timc.idv. tw/ [email protected] 2010-10-31

Google Apps Account as OpenID (中文)

Embed Size (px)

Citation preview

Page 1: Google Apps Account as OpenID (中文)

Google Apps 帳號 OpenID 化

Timothy Chien

http://blog.timc.idv.tw/

[email protected]

2010-10-31

Page 2: Google Apps Account as OpenID (中文)

Google 帳號的 OpenID 化

很久以前就推出的功能 使用者可以複製貼上下列網址

https://www.google.com/accounts/o8/id當作 OpenID 來登入任何 RP 網站– RP 會辨識 (discovery) 出它是伺服器端點(不是使

用者個人網址),接著啟動 id_select 登入程序– 使用者的個人 OpenID 網址會長的像這樣

https://www.google.com/accounts/o8/id?id=AItOwk...nqJOSI

Page 3: Google Apps Account as OpenID (中文)

Google 帳號的 OpenID 化

<?xml version="1.0" encoding="UTF-8"?><xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)"> <XRD> <Service priority="0"> <Type>http://specs.openid.net/auth/2.0/server</Type> <Type>http://openid.net/srv/ax/1.0</Type> <Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type> <Type>http://specs.openid.net/extensions/ui/1.0/icon</Type> <Type>http://specs.openid.net/extensions/pape/1.0</Type> <URI>https://www.google.com/accounts/o8/ud</URI> </Service> </XRD>

</xrds:XRDS>

Page 4: Google Apps Account as OpenID (中文)

「 id_select 」登入程序?

OpenID 2.0 新推出 * 的功能– 說新,其實也是 2007 年的事情了

代表使用者想要用某個特定的 OpenID 帳號提供者 (IdP) ,但他不知道/不說他的個人 OpenID 網址。

因此「 id_select 」登入程序會請 OpenID IdP 自行指定該使用者的 OpenID 網址

另外一種以前就有的稱為「 signon 」登入程序

Page 5: Google Apps Account as OpenID (中文)

Apps 的 OpenID 伺服器端點辨識

用這個https://www.google.com/accounts/o8/site-xrds?hd=example.com

來作為登入 RP 的網址– 使用者會被發給下列形式的 OpenID 個人網址

http://example.com/openid?id=1234567890– 該網域要在此網址底下提供辨識資訊,讓 RP 確

定 Google 沒有說謊

Page 6: Google Apps Account as OpenID (中文)

使用者端點辨識資訊

在 Google 的文件有詳細的說明– http://sites.google.com/site/oauthgoog/fedloginint

erp/openiddiscovery– 它甚至說 XRDS 檔案要有簽名驗證!

我做了產生這些 XRDS 的 PHP 程式– http://github.com/timdream/google-apps-openid– 可以用,但是 XRDS 沒有做簽名驗證– 而且為了跑這個 PHP 還租台主機來架,違背了

Google Apps 的初衷

Page 7: Google Apps Account as OpenID (中文)

使用者端點辨識資訊

<?xml version="1.0" encoding="UTF-8"?><xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)"> <XRD> <CanonicalID>http://example.com/openid?id=1234567890</CanonicalID> <Service priority="0"> <Type>http://specs.openid.net/auth/2.0/signon</Type> <Type>http://openid.net/srv/ax/1.0</Type> <Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type> <Type>http://specs.openid.net/extensions/ui/1.0/icon</Type> <Type>http://specs.openid.net/extensions/pape/1.0</Type> <URI>https://www.google.com/a/example.com/o8/ud?be=o8</URI> </Service> </XRD>

</xrds:XRDS>

Page 8: Google Apps Account as OpenID (中文)

Google 對於代管網域的端點辨識提議

新規格,跟一個放在「 /.well-known/host-meta 」的新檔案有關

現有的 OpenID 生態系尚不支援,除非你架設 RP 的時候把 library 用 Google 寫的 extension 做 patch

– http://code.google.com/googleapps/marketplace/sso.html#gs

應該沒有解決「 Google 可能會說謊」這個問題

Page 9: Google Apps Account as OpenID (中文)

使用者介面

盡量啟動「 id_select 」登入程序– OpenID 個人網址對一般使用者可能沒有意義– 輸入帳號之後再到下一個畫面輸入密碼很怪

可能的 UI– 「輸入您的 E-mail 後繼續」– 按鈕

小心「 NASCAR 效應」

Page 10: Google Apps Account as OpenID (中文)
Page 11: Google Apps Account as OpenID (中文)

example.com/jsmith

[email protected]

example.com

jsmith.example.com

Page 12: Google Apps Account as OpenID (中文)

Q&A