イベントのために、手元にこんな環境を用意してみました。
プロビジョニング)
・AADSyncを使い、オンプレミスのAD DS上のアカウントをAzureAD/OpenDJ/GoogleAppsへID情報を同期します。
・AzureADからGoogleAppsへプロビジョニングを行います。
フェデレーション)
・AzureADをIdPとしてOffice365/GoogleApps/カスタムアプリといったSPへそれぞれws-federation/SAML2.0/OpenID Connectを使ってフェデレーションします。
・AzureADをSPとしてオンプレミスにAD FSを使ったIdPを構築し、ws-federationで接続します。また、先ほどのOffice365等のAzureADのSPの認証をAzureADを経由してAD FSで認証、というマルチプロトコルのフェデレーションのチェインを行います。
・並行してOpenAMをIdPとしてOffice365/GoogleAppsをSPとしてSAML2.0でフェデレーションします。
実際の動きはイベントでお見せするとして、構築方法など細かい話を少しずつ書いていこうと思います。
最初は図の右下部分のOffice365とOpenAMのID連携(SSO)について書いていきます。
完成するとこんな感じで動きます。
1. Office365のポータル(http://portal.office.com/)へアクセスするとログイン画面が表示されます。
2. OpenAMと連携するように構成したドメインのユーザのメールアドレスを入力するとOpenAMへリダイレクトされます。
この時、Office365からOpenAMに向けてSAML2.0の認証リクエストが発行されます。
ポイントはNameID Policyがpersistentとなっているあたりです。IdP(OpenAM)はSP(Office365)向けに永続(固定)のNameIDを渡してあげる必要がある、ということです。実際はOffice365のユーザDBとなるAzure Active Directory(AzureAD)に作成するユーザのImmutableIdという属性の値と一致した値をNameIDには指定します。OpenAM(のユーザDBであるOpenDJ)とAzureADでユーザを同期しておく必要があるので、Forefront Identity Manager(FIM)などのID管理ソリューションを使ってユーザを作成します。(今回はAAD Syncを改造しています。当然非サポートです)このあたりは次回以降で別途解説します。
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="_996b8521-70a0-49b1-809c-c98aba209315"
IssueInstant="2014-11-17T14:20:32Z"
Version="2.0"
AssertionConsumerServiceIndex="0"
>
<saml:Issuer>urn:federation:MicrosoftOnline</saml:Issuer>
<samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" />
</samlp:AuthnRequest>
3. OpenAMへログインします。
認証されるとOpenAMは2で生成されたSAML認証要求に対応する応答メッセージ(SAML Assertion)を生成、ブラウザを経由してOffice365へHTTP/POSTします。
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="s20964a4b3df745e7880a0f3415b3215d3f5b2946c"
InResponseTo="_996b8521-70a0-49b1-809c-c98aba209315"
Version="2.0"
IssueInstant="2014-11-17T14:20:51Z"
Destination="https://login.microsoftonline.com/login.srf"
>
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://openam.example.net:8080/OpenAM-11.0.0</saml:Issuer>
<samlp:Status xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<samlp:StatusCode xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
Value="urn:oasis:names:tc:SAML:2.0:status:Success"
/>
</samlp:Status>
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="s250501aa5c251e616bc9cba9076bfc828a65b086d"
IssueInstant="2014-11-17T14:20:51Z"
Version="2.0"
>
<saml:Issuer>http://openam.example.net:8080/OpenAM-11.0.0</saml:Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<ds:Reference URI="#s250501aa5c251e616bc9cba9076bfc828a65b086d">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<ds:DigestValue>9WyD3at9dL87t4dley8SYe/pxLk=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
Yz43rxDLhDYs1QK0xj29qqVC19ND248iqa9fbgpg6WbJbDqh5Piq0Hyff8YgGnUmOY6vkJG4AMkR
....snip....
t7hjVQqcVvERxydS6xk=
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
MIICQDCCAakCBEeNB0swDQYJKoZIhvcNAQEEBQAwZzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNh
....snip....
cGy/F2Zuj8XJJpuQRSE6PtQqBuDEHjjmOQJ0rV/r8mO1ZCtHRhpZ5zYRjhRC9eCbjx9VrFax0JDC
/FfwWigmrW0Y0Q==
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<saml:Subject>
<saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
NameQualifier="http://openam.example.net:8080/OpenAM-11.0.0"
SPNameQualifier="urn:federation:MicrosoftOnline"
SPProvidedID="kenshinu"
>kenshinu</saml:NameID>
<saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData InResponseTo="_996b8521-70a0-49b1-809c-c98aba209315"
NotOnOrAfter="2014-11-17T14:30:51Z"
Recipient="https://login.microsoftonline.com/login.srf"
/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions NotBefore="2014-11-17T14:10:51Z"
NotOnOrAfter="2014-11-17T14:30:51Z"
>
<saml:AudienceRestriction>
<saml:Audience>urn:federation:MicrosoftOnline</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement AuthnInstant="2014-11-17T14:20:51Z"
SessionIndex="s20d7f191b8306bb263961ed4056b918f749a60501"
>
<saml:AuthnContext>
<saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
<saml:AttributeStatement>
<saml:Attribute Name="IDPEmail">
<saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>kenshinu@o365.hoge.net</saml:AttributeValue>
</saml:Attribute>
</saml:AttributeStatement>
</saml:Assertion>
</samlp:Response>
4. Office365へログインします。
うまくいけばシングルサインオンされます。
今回はここまでです。
次回から、以下の流れで順に解説する予定なのでお楽しみに!
第2回)Office365/OpenAMのID連携設定
カスタムドメインの作成~SSO設定、OpenAMのIdP/SP/CoT(Circle of Trust)定義を行います。
第3回)ユーザのプロビジョニング設定
AADSyncを使ってAzureAD/OpenDJへオンプレミスAD上のユーザを同期します。
0 件のコメント:
コメントを投稿