æãèªã¿OpenID Authentication 1.1 Overview (2)
d:id:ZIGOROu:20070322:1174540380ã®ç¶ã
ã³ã³ã·ã¥ã¼ãã¼ãµã¤ããIdentity URLãåå¾ãã
ã³ã³ã·ã¥ã¼ãã¼ãµã¤ãã¯ã¨ã³ãã¦ã¼ã¶ã¼ã®è¦æ±ããã¢ã¤ãã³ãã£ãã£URLã®ææ¸ãåå¾ãããã³ã³ã·ã¥ã¼ãã¼ã¯headã»ã¯ã·ã§ã³ãopenid.server, openid.delegate宣è¨ã®çºã«ãã¼ã¹ããã
éè¦ãªæ³¨æç¹
- ã¨ã³ãã¦ã¼ã¶ã¼ã¯æã«æªæã®ããã¦ã¼ã¶ã¼ã«ãªããã¾ãã³ã³ã·ã¥ã¼ãã¼ã«ãªããã¾ããå é¨ãããã¯ã¼ã¯ã«ä¾µå ¥ãããããã(ããããäºãã)ã³ã³ã·ã¥ã¼ãã¼ã¯LWPx::ParanoidAgentã®ãããªããªãæ éãªHTTPã©ã¤ãã©ãªã使ãäºãå¼·ãå§ããã
- ã³ã³ã·ã¥ã¼ãã¼ã¯å¿ ãdelegationãå®è£ ããªããã°ãªããªãã
Smart, Dumb(ç¡å£)ã¢ã¼ã
OpenIDèªè¨¼ã¯ã³ã³ã·ã¥ã¼ãã¼ã®è½åã«å¿ãã¦smart modeã¨dumb modeã®ä¸¡æ¹ããµãã¼ããã¦ãã¾ãã
smart modeã®ã³ã³ã·ã¥ã¼ãã¼ã¯æåã«ããå°ãå¦çããã¦æ
å ±ãä¿æãã¾ãããããstateæ
å ±ããã¼ã«ã«ã«ãã£ãã·ã¥ããäºãå¿
è¦ã§ãã*1
dumb modeã®ã³ã³ã·ã¥ã¼ãã¼ã¯å®å
¨ã«statelessã§ããããããã«è¿½å ã§HTTP Requestãå¿
è¦ã¨ãã¾ãã
éè¦ãªæ³¨æç¹
- ã³ã³ã·ã¥ã¼ãã¼ãæåã«éä¿¡ããã¨ã³ãã¦ã¼ã¶ã¼ã®IdPã¸ã®ãªã¯ã¨ã¹ãã¨å ±ééµãã¾ã ããããã£ãã·ã¥ãã¦ããªãå ´åã¯çµã³ã¤ãã¦ãªã¯ã¨ã¹ãããäºãæ¨å¥¨ãããå°æ¥ã®identityãã§ãã¯ãªã¯ã¨ã¹ãã«ããã¦ãHMAC-SHA1ã§æå·åãã¹ãã§ããããã®shared secretã¯æéãåããã¾ã§å©ç¨ãããã
- å ±ééµã¯Diffie-Hellman-negotiated secretã«ãã£ã¦plain textã¨encryptedã«ç¸äºã«å¤æå¯è½ã§ãããDiffel-Hellmanã使ã£ãå ´åãassociateã¢ã¼ãã®ä¸ã§ã ã使ããããcheckid_immediateãcheckid_setupã¢ã¼ãã¯æ¢ã«shared secretãã©ã®ããã«åå¾ãããã«é¢ãããã³ã³ã·ã¥ã¼ãã¼ãæ¢ã«åå¾ãã¦ããäºãåæã¨ããã
ã³ã³ã·ã¥ã¼ãã¼ãã¢ã¤ãã³ãã£ãã£ã確èªãã
ã³ã³ã·ã¥ã¼ãã¼ã¯ç¾å¨ãIdPã®URLãcheckid_immediateã¢ã¼ã(ã¾ãã¯checkid_setup)ã®URLãä½ãããããUser-Agentã«éãã¾ããããããUser-Agentã«éãäºã«ãã£ã¦ãã¨ã³ãã¦ã¼ã¶ã¼ã®Cookieã¨ãããªããã°ã¤ã³è¨¼æãä¿¡é ¼ãããIdPã«éãè¿ããã¾ããIdPããããã©ã®ããã«è¡ããã¯openid.return_toã«ãã£ã¦URLãã¬ã¹ãã³ã¹ã«è¿½å ãããããUser-Agentã«éããã³ã³ã·ã¥ã¼ãã¼ã®ãµã¤ãã«æ»ãã¾ãã
ã¾ã¨ã
å ¨ä½çã«ãã®smart, dumbã¢ã¼ãã®éãã£ã¦statefull, statelessã®éãã®ããã«èªãããã§ãããæç« ããã ã¨ç¢ºä¿¡ãæã¦ãªãã
ã¾ãHMA-SHA1ã¯è»½ãgoogleã«èãã¦ã¿ãæã
HMAC-SHA1ï¼ããã·ã¥é¢æ°SHA1ãã¼ã¹ã®ã¡ãã»ã¼ã¸èªè¨¼ã³ã¼ãï¼RFC 2104ï¼
Hãããã·ã¥é¢æ°ï¼SHA1ï¼ãKãç§å¯éµãMãã¡ãã»ã¼ã¸ã¨ããã¨HMAC-SHA1ã®å®ç¾©å¼ã¯ä»¥ä¸ã®ããã«ãªããããã§ãipadãopadã¯å®ããããããã£ã³ã°å¤ã§xorã¯æä»ORã®æä½ã示ããHMAC-SHA1(K, M)ï¼H(K xor ipad, H(K xor opad, M))
http://www.atmarkit.co.jp/fsecurity/rensai/webserv03/webserv01a.html
ã ããã§ãã
ããã«Diffel-Hellmanã§ãããéµå ±æã®æå·ãããã³ã«ã ããã§ãã
Perlã§ãå®è£ ãããã¾ããã
*1:statefullã£ã¦äºï¼