LoginSignup
0
1

More than 3 years have passed since last update.

異なるActive Directory間の複数ADFS間連携(multiple AD FS federation)[2/3]

Posted at

4.5. YELLOW上のBLUE要求プロバイダー信頼の要求規則(受け付け変換規則)を作成する

上記4.2.のYELLOW上のBLUE要求プロバイダー信頼のの要求規則(受け付け変換規則Acceptance Transform Rules)を作成します。
BULE側ADFSから受け取ったNameIDタグをそのままYELOOW側ADFSへ渡すため”入力方向の要求をパススルーまたはフィルター処理”にて追加します。これは必須の設定です(下図)。
4.5_002mini.png

また、今回は、BLUE側から受け取った属性もApp側に渡したいので ↑ に加えて、その他属性を追加する要求記述も追加します。これは必須ではありません。
一個一個属性を記載するのは面倒なので、全属性を渡す処理を”カスタム規則を使用して要求を送信”で記載します(下図)。
4.5_003mini.png
この ↑ の図中のカスタム規則は手動で以下を入力します。

x:[]
 => issue(claim = x);

 
これは渡された全属性をそのまま横へ流すという記載です(テストのときとか超便利)。
ここの要求記述の文法は以下が詳しいです。

4.6. YELLOW上のApp利用者信頼の要求規則を作成する

上記4.3.のYELLOW上のApp利用者信頼の要求規則(発行変換規則 Issuance Transform Rules)を作成します。
ここが今回の投稿の肝です。BLUEから渡された属性(BLUE側ADではwwwhomepage属性)をキー値(YELLOW側ADのUserPrincipalName属性)としてYELLOW側ADの各種属性値を取得し、Appへセキュリティトークンとして送出します。
要求規則は手動でしかできないため手動(”カスタム規則を使用して要求を送信”)で記載します。ここではupnとgivennameをYELLOW側ADから拾ってみます。

c:[Type == "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"]
 => issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn", 
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname"), query = "userPrincipalName={0};userPrincipalName,givenName;YELLOW\adfs-svc", param = c.Value);

ADFS上でこんな風に見えます。
4.6_001mini.png

次に、BLUE側から送り込まれているトークンをそのまま、横流しします。すべての属性を”入力方向の要求をパススルーまたはフィルター処理”で拾ってもいいのですが、今回は渡された全属性をそのまま横へ流すという記載(超便利)をまた利用します。
具体的な”カスタム規則を使用して要求を送信”は(下図)。
4.6_002mini.png

これでおわりです!お疲れさまでした!

4.7. トークン内容をC#コンソールツール書いて確認する

トークンがでているかC#アプリをWIF4.5とWCFを書いて出力した結果は以下となります。
全項目横流ししたせいで、x-ms-client-ipとかもおまけで出力されていますね。

<Attribute Name="meowmeow" a:OriginalIssuer="http://adfs.blue.com/adfs/services/trust" xmlns:a="http://schemas.xmlsoap.org/ws/2009/09/identity/claims">
<AttributeValue>magpie.robin@yellow.net</AttributeValue></Attribute>

<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn" a:OriginalIssuer="http://adfs.blue.com/adfs/services/trust" xmlns:a="http://schemas.xmlsoap.org/ws/2009/09/identity/claims">
<AttributeValue>magpie@blue.com</AttributeValue></Attribute>

<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" a:OriginalIssuer="http://adfs.blue.com/adfs/services/trust" xmlns:a="http://schemas.xmlsoap.org/ws/2009/09/identity/claims">
<AttributeValue>magpie@mail.blue.com</AttributeValue></Attribute>

#中略
<Attribute Name="http://schemas.microsoft.com/2012/01/requestcontext/claims/x-ms-client-ip" a:OriginalIssuer="CLIENT CONTEXT" xmlns:a="http://schemas.xmlsoap.org/ws/2009/09/identity/claims">
<AttributeValue>172.30.100.61</AttributeValue></Attribute>



<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn">
<AttributeValue>magpie.robin@yellow.net</AttributeValue></Attribute>

<Attribute Name="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname">
<AttributeValue>magpie.yellow</AttributeValue>

ADFSの構成は異常ですが、次回[3]ではWIF4.5コードとその他要求記述などについて記載します!

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1