ã¯ããã«
ã¿ãªããã¯ããã¾ãã¦ãBASEã§ã¨ã³ã¸ãã¢ããã¦ããã¾ãç°æ ( taiyou )ã§ãã
å æ¥ãBASEã§ã¯ã·ã§ãããªã¼ãã¼åãã®ã³ãã¥ããã£ãµã¤ããBASE Streetãã«ãã°ã¤ã³ããããã®æ©è½ã¨ãã¦SSOãã°ã¤ã³æ©è½ããªãªã¼ã¹ãã¾ããã SSOãã°ã¤ã³ãå®ç¾ããããã®èªè¨¼æ¹å¼ã¯ããã¤ãããã®ã§ãããå¼ç¤¾ã§ã¯SAMLèªè¨¼æ¹å¼ãç¨ãã¦å®ç¾ãã¾ããã ãã®ããããã®è¨äºã§ã¯SAMLèªè¨¼æ©æ§ã®IdPã¨ãã¦OSSã使ããã«SAMLèªè¨¼æ©è½ãå®è£ ããæ¹æ³ãç´¹ä»ãã¾ãã
ååã®ããã¯ããã°ã§ããã®SSOãã°ã¤ã³æ©è½ã®ããã³ãå´ãéçºããPJã¡ã³ãã¼ã®è¥èãããµã¼ãã¼ãµã¤ãã¨ã³ã¸ãã¢ãããã³ãã¨ã³ãã«ææ¦ãã¦æé«ã®çµé¨ã«ãªã£ã話ããå·çããã®ã§ãã¡ããè¦ã¦ã¿ã¦ãã ããï¼
SAMLèªè¨¼æ©è½ãæä¾ãã¦ããOSSã«ã¯ãKeycloakãªã©ãããã¾ãããBASEã§ã¯ä»¥ä¸ã®çç±ã«ããèªåå®è£ ãããã¨ã«ãã¾ããã
- æ¢ã«å¤§éã®ã¦ã¼ã¶ã¼æ å ±ã管çãã¦ãããKeycloakãªã©ã«ã¦ã¼ã¶ã¼æ å ±ã®é£æºãè¡ãå¿ è¦ããã
- å¼ç¤¾ã§æ¡ç¨ãã¦ããPHP, Goã§å®è£ ãããæåãªOSSããªããããå¼ç¤¾ã¨ã³ã¸ãã¢ã§ç®¡çã»éç¨ãããã¼ãã«ãé«ã
- SAMLèªè¨¼æ©è½ãæããã©ã¤ãã©ãªï¼lightSAMLï¼ããããèªåå®è£ ã®ã³ã¹ããé«ããªãã£ã
以ä¸ã®çç±ã«ãããOSSã使ããã«IdPã¨ãã¦SAMLèªè¨¼æ©è½ãéçºãã¾ããã
対象èªè
- SAMLèªè¨¼ã«ã¤ãã¦ãããã調ã¹ããã¨æã£ã¦ããæ¹
- IdPã¨ãã¦keycloakãªã©ã®OSSã使ããã«SAMLèªè¨¼æ©è½ãéçºããã¨ã³ã¸ãã¢
SAMLèªè¨¼ã¨ã¯ï¼
SAMLèªè¨¼ã¨ã¯ãã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ãå®ç¾ããä¸ã¤ã®èªè¨¼æ¹å¼ã§ãã
ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ã¨ã¯ï¼
Single sign-on (SSO) is an authentication scheme that allows a user to log in with a single ID to any of several related, yet independent, software systems.
True single sign-on allows the user to log in once and access services without re-entering authentication factors.
Single sign-on - Wikipediaããå¼ç¨
ã·ã³ã°ã«ãµã¤ã³ãªã³(SSO)ã¨ã¯ãã¦ã¼ã¶ã¼ã1ã¤ã®IDã§è¤æ°ã®ãµã¼ãã¹ã«ãã°ã¤ã³ã§ããããèªè¨¼æ¹æ³ã§ãã ãã®ã·ã³ã°ã«ãµã¤ã³ãªã³ã«ããã¦ã¼ã¶ã¼ã¯ä¸åº¦ãã°ã¤ã³ããã°ãèªè¨¼è¦ç´ ãåå ¥åãããã¨ãªããµã¼ãã¹ã«ã¢ã¯ã»ã¹ãããã¨ãã§ãã¾ãã
SAMLèªè¨¼ã¯ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ãå®ç¾ããããã®èªè¨¼æ¹å¼
ä¸è¨ã®ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼ä»¥ä¸ãSSOã¨å¼ç§°ï¼ãå®ç¾ããèªè¨¼æ¹å¼ã¯ãSingle sign-on - Wikipediaã§è¨è¼ããã¦ããéãããã¤ãããã¾ããSAMLèªè¨¼ã¯ããã®SSOãå®ç¾ããããã®ä¸ã¤ã®èªè¨¼æ¹å¼ã§ãã
SAMLèªè¨¼æ¹å¼ä»¥å¤ã®æ¹æ³ã«ã¤ãã¦ã¯ã以ä¸ã®æç®ãåç §ãã¦ãã ããã
- Single sign-on - Wikipedia#Common_configurations
- ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ã¨ã¯-æ¦è¦ã»ä»çµã¿ | GMOãã©ã¹ãã»ãã°ã¤ã³(SSO/IDaaS)
SAMLèªè¨¼ã®ããã¼
ããã§ã¯ãSAMLèªè¨¼æ¹å¼ã§SSOãè¡ãããã®ããã¼ã説æãã¾ãã以éã§SAMLèªè¨¼ã®ããã¼ã«ã¤ãã¦èª¬æããåã«ããµã¼ãã¹ãããã¤ãã¼ï¼SPï¼ã¨ã¢ã¤ãã³ãã£ãã£ãããã¤ãã¼ï¼IdPï¼ã«ã¤ãã¦èª¬æãã¾ãã
ãµã¼ãã¹ãããã¤ãã¼ï¼SPï¼
æåéããã¦ã¼ã¶ã¼ã«å¯¾ãã¦ã¢ããªã±ã¼ã·ã§ã³ãµã¼ãã¹ãæä¾ãããã®ã§ããã¦ã¼ã¶ã¼ããµã¼ãã¹ãããã¤ãã¼ï¼ä»¥éãSPã¨å¼ç§°ï¼ã«ãã°ã¤ã³ããéãå¾è¿°ããã¢ã¤ãã³ãã£ãã£ãããã¤ãã¼ã«ã¦ã¼ã¶ã¼èªè¨¼ãè¡ã£ã¦ãããSPã«ãã°ã¤ã³ãã¾ãã
ã¢ã¤ãã³ãã£ãã£ãããã¤ãã¼ï¼IdPï¼
ã¦ã¼ã¶ã¼ã®èªè¨¼ã«å¿ è¦ãªæ å ±ã管çãã¦ããã®ãã¢ã¤ãã³ãã£ãã£ãããã¤ãã¼ã§ããã¢ã¤ãã³ãã£ãã£ãããã¤ãã¼ã§ã¯ãSPããéä¿¡ãããèªè¨¼ãªã¯ã¨ã¹ããå¦çããã¦ã¼ã¶ã¼æ å ±ãSPã«è¿å´ãã¾ãã
SAMLèªè¨¼ããã¼
詳ããå 容ã¯ãSecurity Assertion Markup Language - Wikipediaãåç §ãã¦ãã ããã
Security Assertion Markup Language - Wikipediaããå¼ç¨
1. SPã®ãã¼ã¸ã¸ã¢ã¯ã»ã¹ãã
ã¾ãã¦ã¼ã¶ã¼ã¯SPã®ãã¼ã¸ã«ã¢ã¯ã»ã¹ããã¨ãã¾ãããã®ã¨ããã¦ã¼ã¶ã¼ãæ¢ã«SPå´ã§èªè¨¼æ¸ã¿ã®å ´åã¯SAMLèªè¨¼ãè¡ãå¿ è¦ããªãããããã¼ã¸ã表示ããã¾ããèªè¨¼ããã¦ããªãå ´åã¯ãIdPã¸ãªãã¤ã¬ã¯ãããã¾ãã
2. IdPã¸ãªãã¤ã¬ã¯ããã
ã¦ã¼ã¶ã¼ãã¾ã èªè¨¼ããã¦ããªãå ´åã¯ãIdPã¸ãªãã¤ã¬ã¯ãããã¾ããIdPã¸ãªãã¤ã¬ã¯ããããéã«ãã¯ã¨ãªãã©ã¡ã¼ã¿ã¼ã«SAMLRequest
ãã©ã¡ã¼ã¿ã¼ãä»ä¸ããã¾ãããã®SAMLRequest
ã¯IdPã«èªè¨¼ã®è¦æ±ãããéã«å¿
è¦ã¨ãªã以ä¸ã®ãããªxmlå½¢å¼ã®æ
å ±ãå§ç¸®ããæååã«ãªãã¾ãã
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="{èªè¨¼è¦æ±ID}" Version="2.0" ProviderName="{ãµã¼ãã¹ãããã¤ãã¼å}" IssueInstant="{SAMLRequestã®çææ¥æ}" Destination="{SAMLRequestã®éä¿¡å IdPã®URL}" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="{èªè¨¼çµæã®POSTå SPã®URL}"> <saml:Issuer>http://sp.example.com/hoge/metadata.php</saml:Issuer> <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true"/> <samlp:RequestedAuthnContext Comparison="exact"> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> </samlp:RequestedAuthnContext> </samlp:AuthnRequest>
3. SAMLRequestãæ¤è¨¼/ã¦ã¼ã¶ã¼èªè¨¼ãè¡ãã¾ã
IdPã§ã¯ãã¾ãã¦ã¼ã¶ã¼ã®ãã©ã¦ã¶(ã¦ã¼ã¶ã¼ã¨ã¼ã¸ã§ã³ã)ãçµç±ãã¦SPããéä¿¡ãããSAMLRequest
ã®æ¤è¨¼ãè¡ãã¾ãããã®æ¤è¨¼ã§ã¯ãé»åç½²åä»ãã®SAMLRequest
ãéä¿¡ãããå ´åã§ã¯ãé»åç½²åãè¡ãã¾ãã
SAMLRequest
ã®æ¤è¨¼ãçµäºããããã¦ã¼ã¶ã¼èªè¨¼ã®ããã«ãã°ã¤ã³ãã¼ã¸ã表示ãã¾ããã¦ã¼ã¶ã¼ã¯IdPã«ç»é²ããã¡ã¼ã«ã¢ãã¬ã¹ããã¹ã¯ã¼ããå
¥åãã¾ãã
4. SAMLResponseãçæãã¾ã
ã¦ã¼ã¶ã¼èªè¨¼ã®ããã®æ
å ±ããã©ã¼ã ã«å
¥åãã¦éä¿¡ããããIdPå´ã§ãã°ã¤ã³å¦çãè¡ãã¾ããããã¦ããã°ã¤ã³ã«æåããããSPã«éä¿¡ããSAMLResponse
ãçæãã¾ãããã®SAMLResponse
ã¯SPå´ã§ã¦ã¼ã¶ã¼èªè¨¼ãè¡ãéã«å©ç¨ããæ
å ±ãxmlã«æ ¼ç´ãã¾ãã
SAMLResponseã®ä¾
<?xml version="1.0" encoding="UTF-8"?> <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Destination="{SAMLResponseã®éä¿¡å SPã®URL}" ID="{IdPå´ã§çºè¡ããID}" InResponseTo="{SPããéä¿¡ãããSAMLRequestã«å«ã¾ããèªè¨¼è¦æ±ID}" IssueInstant="{SAMLResponseãçºè¡ããæ¥æ}" Version="2.0"> <saml:Issuer>{IdPã®URL}</saml:Issuer> <samlp:Status> <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" /> </samlp:Status> <saml:Assertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="{IdPå´ã§çºè¡ããID}" IssueInstant="{SAMLResponseãçºè¡ããæ¥æ}" Version="2.0"> <saml:Issuer>{IdPã®URL}</saml:Issuer> <dsig:Signature xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"> <dsig:SignedInfo> <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> <dsig:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" /> <dsig:Reference URI="#ID_b93d4d7d-1937-474f-84df-2f3440025a3c"> <dsig:Transforms> <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /> <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> </dsig:Transforms> <dsig:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" /> <dsig:DigestValue>{ããã·ã¥å¤}</dsig:DigestValue> </dsig:Reference> </dsig:SignedInfo> <dsig:SignatureValue>{é»åç½²åã®å¤}</dsig:SignatureValue> <dsig:KeyInfo> <dsig:X509Data> <dsig:X509Certificate>{IdPå´ã§çºè¡ãã証ææ¸}</dsig:X509Certificate> </dsig:X509Data> </dsig:KeyInfo> </dsig:Signature> <saml:Subject> <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">{ãã°ã¤ã³å¯¾è±¡ã¨ãªãã¦ã¼ã¶ã®ã¡ã¼ã«ã¢ãã¬ã¹}</saml:NameID> <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer"> <saml:SubjectConfirmationData InResponseTo="{SPããéä¿¡ãããSAMLRequestã«å«ã¾ããèªè¨¼è¦æ±ID}" NotOnOrAfter="{SAMLResponseã®æå¹æé}" Recipient="{SAMLResponseã®éä¿¡å SPã®URL}" /> </saml:SubjectConfirmation> </saml:Subject> <saml:Conditions NotBefore="{SAMLResponseã®æå¹æééå§æ¥æ}" NotOnOrAfter="{SAMLResponseã®æå¹æéçµäºæ¥æ}"> <saml:AudienceRestriction> <saml:Audience>{SPã®ãã¡ã¤ã³}</saml:Audience> </saml:AudienceRestriction> </saml:Conditions> <saml:AuthnStatement AuthnInstant="{SAMLResponseãçºè¡ããæ¥æ}" SessionIndex="{IdPå´ã§çºè¡ããID}" SessionNotOnOrAfter="{IdPå´ã®ã»ãã·ã§ã³æå¹æé}"> <saml:AuthnContext> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified</saml:AuthnContextClassRef> </saml:AuthnContext> </saml:AuthnStatement> <saml:AttributeStatement> ... </saml:AttributeStatement> </saml:Assertion> </samlp:Response>
5. SPã¸SAMLèªè¨¼æ å ±ãPOSTãã¾ã
IdPå´ã§SAMLResponse
ã®çæãå®äºãããã次ã®ãããªHTMLãã¬ã³ããªã³ã°ããPOSTãã¾ãã
<form method="post" action="https://sp.example.com/saml2/sso/post" ...> <input type="hidden" name="SAMLResponse" value="{XMLå½¢å¼ã®SAMLResponseãbase64ã¨ã³ã³ã¼ãã£ã³ã°ããå¤}" /> ... <input type="submit" value="Submit" /> </form>
ã¬ã³ããªã³ã°ããéãJavaScriptå´ã§ç»é¢ã表示ããããsubmitãã¿ã³ãèªåã§æ¼ä¸ããå¦çãè¡ããã¨ã§ã¦ã¼ã¶ã¼ã¯SPç»é¢ã¸èªåé·ç§»ããããã«ãªãã¾ãã
6. SPã®ãã¼ã¸ã表示ããã
SPå´ã§IdPããéãããSAMLResponse
ã®æ¤è¨¼ãçµäºãããã°ã¤ã³å¦çãçµäºããããSAMLèªè¨¼ã¯æåã§ããããã§ãã¦ã¼ã¶ã¼èªè¨¼ãå¿
è¦ãªSPã®ãã¼ã¸ã表示ããã¾ãã
SAMLèªè¨¼ãå®ç¾ããæ¹æ³
ä¸è¨ã§èª¬æããSAMLèªè¨¼ãå®ç¾ããããã®æ¹æ³ã¨ãã¦ã次ã®ï¼ã¤ãèãããã¾ãã
æ¹æ³1. OSSãå©ç¨ãã
SAMLèªè¨¼ãå®ç¾ããããã®ä»£è¡¨çãªæ¹æ³ã¨ãã¦ãOSSã©ã¤ãã©ãªãå©ç¨ããæ¹æ³ãããã¾ããç¾å¨ãSAMLèªè¨¼æ©è½ãæä¾ã§ããOSSã¨ãã¦ä»¥ä¸ã®ãã®ãããã¾ãã
- Keycloak : https://github.com/keycloak/keycloak
ãããã®OSSãå©ç¨ãããã¨ã§ãã¦ã¼ã¶ã¼ã«å¯¾ãã¦SAMLèªè¨¼æ©è½ãæä¾ãããã¨ãã§ãã¾ãã
ã¡ãªããã¨ãã¡ãªããã¯ãããã以ä¸ã®éãã§ãã
- ã¡ãªãã
- OSSãcloneããSAMLèªè¨¼ç¨ãµã¼ãã¼ãç¨æããèµ·åããã°SAMLèªè¨¼æ©è½ãæä¾ã§ãããã¨
- ãã¡ãªãã
- SAMLèªè¨¼ç¨ãµã¼ãã¼ã®ä¿å®ãæ°ãã«å¿ è¦ã«ãªã
- BASEã®ããã«æ¢ã«ã¦ã¼ã¶ã¼ãã¼ã¿ã管çããã¦ããå ´åã¯ãBatchãAPI, MQãªã©ãå©ç¨ãã¦SAMLèªè¨¼ç¨ãµã¼ãã¼ã«ãã¼ã¿ãé£æºããå¿ è¦ããã
æ¹æ³2. èªåã§SAMLèªè¨¼æ©è½ãéçºãã
å¥ã®æ¹æ³ã¨ãã¦ãæ¢ã«æä¾ãã¦ãããµã¼ãã¹ã®1æ©è½ã¨ãã¦SAMLèªè¨¼æ©è½ãéçºããæä¾ããæ¹æ³ãããã¾ããã¤ã¾ããSAMLèªè¨¼ç¨ã®ã¨ã³ããã¤ã³ãã¨SAMLèªè¨¼ç¨ã®ãã°ã¤ã³ãã©ã¼ã ãªã©ãéçºãããã¨ã§æä¾ããæ¹æ³ã§ãã
- ã¡ãªãã
- 稼åä¸ã®ãµã¼ãã¹ã®1æ©è½ã¨ãã¦æä¾ããã®ã§ãæ°ãã«SAMLèªè¨¼ç¨ãµã¼ãã¼ãç¨æããå¿ è¦ããªããéç¨ã³ã¹ããæãããã
- ã¦ã¼ã¶ã¼èªè¨¼ã«å¿ è¦ãªæ å ±ãOSSãªã©ã«é£æºããå¿ è¦ããªã
- ãã¡ãªãã
- SAMLèªè¨¼æ©è½ãéçºããå®è£ é£æ度ãæ¯è¼çé«ã
BASEã§ã¯ã次ã®ï¼ã¤ã®çç±ããæ¹æ³2ãæ¡ç¨ãã¾ããã
- SAMLèªè¨¼æ©è½ãå©ç¨ããã¦ã¼ã¶ã¼ãéããã¦ãããããkeycloakã®ã¡ã³ããã³ã¹ã»ã©ã³ãã³ã°ã³ã¹ãã¨ã¦ã¼ã¶ã¼ã¸ã®è²»ç¨å¯¾å¹æãé£ãåããªã
- BASEã§ã¯æ¢ã«å¤§éã®ã¦ã¼ã¶ã¼æ å ±ã管çãã¦ããããããããkeycloakã«é£æºããå¿ è¦ããã
- å¼ç¤¾ã§æ¡ç¨ãã¦ããPHP, Goã§å®è£ ãããå©ç¨å®ç¸¾ã®ããæåãªOSSããªããããå¼ç¤¾ã¨ã³ã¸ãã¢ã§ç®¡çã»éç¨ãããã¼ãã«ãé«ã
IdPã¨ãã¦BASEã§ã¯ã©ã®ãããªè¨è¨ã«ãªã£ããï¼
BASEã®ããã«æ¢ã«ãµã¼ãã¹ã«ç»é²ãã¦ããã¦ã¼ã¶ã¼ã®SAMLèªè¨¼ãè¡ãéã«ãBASEã§ã¯ã©ã®ãããªè¨è¨ã«ãªã£ãã®ãç´¹ä»ãã¦ããã¾ãã
SAMLèªè¨¼ã®ããã®å¿ è¦ãªæ©è½ã¨ãã¼ã¸
å ·ä½çãªè¨è¨ã®ç´¹ä»ã«å ¥ãåã«ãIdPã¨ãã¦BASEã§ã¯ãããããã©ã®ãããªæ©è½ãå¿ è¦ãªã®ããæããã«ãã¦ãã¾ããSAMLèªè¨¼ã®ããã®å¿ è¦ãªæ©è½ã¯ä»¥ä¸ã®éãã§ãã
æ©è½ | 説æ |
---|---|
SAMLRequestã®æ¤è¨¼æ©è½ | SPããã¯ã¨ãªãã©ã¡ã¼ã¿ã¼ã§éä¿¡ãããSAMLRequestãæ¤è¨¼ããæ©è½ã§ããSPå´ã§é»åç½²åãè¡ã£ã¦ããå ´åãªã©æ¤è¨¼ãå¿ è¦ãªå ´åã«å¼ã³åºãããæ©è½ã§ãã |
ãã°ã¤ã³å¤å®æ©è½ | SPãããªãã¤ã¬ã¯ããããã¦ã¼ã¶ã¼ãBASEã«æ¢ã«ãã°ã¤ã³ãã¦ãããå¤å®ããæ©è½ã§ãããããã°ã¤ã³æ¸ã¿ã®å ´åã¯ããã°ã¤ã³å¦çãã¹ãããããããã«ãã¾ãã |
ãã°ã¤ã³æ©è½ | ã¡ã¼ã«ã¢ãã¬ã¹ããã¹ã¯ã¼ããªã©ã¦ã¼ã¶ã¼æ å ±ãæå®ãããã¨ã§ãã°ã¤ã³å¦çãè¡ãæ©è½ã§ããæ©è½èªä½ã¯é常ã®ãã°ã¤ã³ã¨å·®ç°ã¯ããã¾ããã |
SAMLResponseã®çææ©è½ | ã¡ã¼ã«ã¢ãã¬ã¹ãã¦ã¼ã¶ã¼ãã¼ã ãªã©ã®ã¦ã¼ã¶ã¼æ å ±ã¨SPããéä¿¡ãããSAMLRequestããSAMLResponseãçæããæ©è½ã§ãã |
ã¾ããå¿ è¦ãªãã¼ã¸ã¯ä»¥ä¸ã®éãã§ãã
ãã¼ã¸ | 説æ |
---|---|
SSOãã°ã¤ã³ãã¼ã¸ | SSOãã°ã¤ã³ã®ããã«å¿ è¦ãªãã©ã¼ã ãæãããã¼ã¸ã§ãã |
SPãªãã¤ã¬ã¯ããã¼ã¸ | SAMLResponseãSPã«éä¿¡ããããã®ãã©ã¼ã ãã¼ã¸ã§ããé常ããã®ãã¼ã¸ã§ã¯ã¦ã¼ã¶ã¼èªèº«ããã©ã¼ã ã®éä¿¡ãã¿ã³ãæ¼ãã®ã§ã¯ãªãããã¼ã¸ããã¼ãããããjsã§éä¿¡ãã¿ã³ãæ¼ãããã«å®è£ ããã¾ãã |
SPããBASEã«ãªãã¤ã¬ã¯ããããéã®ç»é¢é·ç§»ã¨ãã¦ã¯ãSSOãã°ã¤ã³ãã¼ã¸ã§ãã°ã¤ã³ãè¡ããSAMLResponseãSPã«ãã©ã¼ã POSTããSPãªãã¤ã¬ã¯ããã¼ã¸ã表示ãããããªç»é¢é·ç§»ã«ãªãã¾ãã
ãããã®æ©è½ã¨ãã¼ã¸ãããããã©ã®ããã«ããã¨ãããã®ã詳細ã®è¨è¨ãç´¹ä»ãã¾ãã
å¦çã®æµã
1. SPããBASEã«ãªãã¤ã¬ã¯ãããã
SPããBASEã«ãªãã¤ã¬ã¯ãããããã次ã®å¦çãè¡ãã¾ãã
- SAMLRequestã®æ¤è¨¼å¦ç
- ãã°ã¤ã³ã®å¤å®å¦ç
æ¢ã«BASEã«ãã°ã¤ã³ãã¦ããå ´åã¯ãã3. SAMLResponseãçæããSPã«ãªãã¤ã¬ã¯ããããã¸é²ã¿ã¾ãã BASEã«ãã°ã¤ã³ãã¦ããªãå ´åã¯ããã°ã¤ã³ãã¼ã¸ã表示ãã¾ãã
2. BASEã«ãã°ã¤ã³ãã
ãã°ã¤ã³ãã¼ã¸ã表示ããããããã°ã¤ã³å¦çã«å¿ è¦ãªã¡ã¼ã«ã¢ãã¬ã¹ã¨ãã¹ã¯ã¼ããå ¥åããsubmitãã¾ããä»åBASEã§éçºããSAMLèªè¨¼æ©è½ã§ã¯ãã§ã«BASEãµã¼ãã¹ã«ç»é²ãã¦ããã¦ã¼ã¶ã¼ã«ã®ã¿æä¾ããæ©è½ãªã®ã§æ°è¦ç»é²ãã©ã¼ã ã¯é¤å¤ãã¦ãã¾ãã
3. SAMLResponseãçæããSPã«ãªãã¤ã¬ã¯ããã
ãã°ã¤ã³å¦çãæ£å¸¸ã«å®äºããããSPã¸è¿ãèªè¨¼æ å ±ã§ããSAMLResponseãçæãã¾ããSAMLResponseãçæããããSPãªãã¤ã¬ã¯ããã¼ã¸ã表示ãã¾ãããã®SPãªãã¤ã¬ã¯ããã¼ã¸ã¯ã次ã®ãããªSPã¸POSTãããã©ã¼ã ãã¼ã¸ã§ãã
<form method="post" action="https://sp.example.com/saml2/sso/post" ...> <input type="hidden" name="SAMLResponse" value="{SAMLResponseãbase64ã¨ã³ã³ã¼ãã£ã³ã°ããå¤}" /> ... <input type="submit" value="Submit" /> </form>
ãã®å ´åãã¦ã¼ã¶ã¼ãæåã§submitãã¿ã³ãæ¼ããã¨ã§SPã¸é·ç§»ãããã¨ãå¯è½ã§ãããSAMLèªè¨¼æ©è½ãæä¾ããå¤ãã®ãµã¼ãã¹ã¯ãã¼ã¸ããã¼ãããããèªåã§submitãã¿ã³ãæ¼ä¸ããjavascriptã³ã¼ããå®è£ ãããã¨ã§èªåé·ç§»ããããã«ãã¦ãã¾ãã
ãããã«
ãã®è¨äºã§ã¯ãOSSã使ããã«IdPã¨ãã¦SAMLèªè¨¼æ©è½ãéçºããæ¹æ³ã«ã¤ãã¦ç´¹ä»ãã¾ããã IdPã¨ãã¦SAMLèªè¨¼æ©è½ãæä¾ããæ¹æ³ã¨ãã¦ããããã â OSSãå©ç¨ãã â¡èªåå®è£ ãã æ¹æ³ãããã¾ããä»åãBASEã§ã¯â¡èªåå®è£ ããæ¹æ³ãæ¡ç¨ããéçºãè¡ãã¾ããããã®éçºä¸ã«ç§ãè¦å´ããç¹ã¨ãã¦ãSAMLèªè¨¼ã«ã¤ãã¦ã®è³æãå°ãªãã£ãããããããã¾ãããã®ããããã®è¨äºãã¿ãªããã®åèã«å°ãã§ããªããã°å¹¸ãã§ãã
åèæç®
- Security Assertion Markup Language - Wikipedia
- Using HTTP POST binding in OpenSAML 4 | SAMLSecurity
- How to turn your PHP website into a SAML Identity Provider in 30 minutes | by Duarte Garin | Prosple Engineering | Medium
- RFC 7522 - Security Assertion Markup Language (SAML) 2.0 Profile for OAuth 2.0 Client Authentication and Authorization Grants
- ã·ã³ã°ã«ãµã¤ã³ãªã³ï¼SSOï¼ã¨ã¯-æ¦è¦ã»ä»çµã¿ | GMOãã©ã¹ãã»ãã°ã¤ã³(SSO/IDaaS)