SlideShare uma empresa Scribd logo
1 de 59
企業利用者のための Windows Phone アプリ開発
~業務アプリケーションの配信と管理を実装する

Part II
アプリケーションに
認証機能を実装する
2011.12.1 V1.01
日本マイクロソフト株式会社
エバンジェリスト
安納 順一(あんのう じゅんいち)
http://blogs.technet.com/junichia/
twitter @junichia
Agenda
 1.   クラウドサービスとオンプレミス認証基盤の連携方法
      •   Windows Azure インスタンスと Active Directory の連携方法


 2.   Windows Phone から認証基盤にアクセスする方法
      •   Silverlight アプリから Active Directory で認証する方法


 3.   WEB サービスが Active Directory で認証されたアプリケーションを
      受け入れる方法
      •   WCFサービス が Active Directory の認証結果を受け入れる方法
            お時間の都合上、この部分の詳しい解説は割愛させていただきます



                                                         2
はじめに



       3
復習:業務サービスの構成
1.       業務サービスの場所
     ①   オンプレミス              いずれの場合も認証
     ②   一部または全部がクラウド        基盤との連携が重要


2.       業務サービスへの接続アプリ
     ①   Internet Explorer    認証基盤との
     ②   Silverlight アプリ     連携方法が異なる



                                         4
業務アプリの「使い勝手」を考えれば...

   IE9 Mobile       クラウドアプリ


                    Active Directory ファミ
                    リ
                    SharePoint Server
   Silverlight アプ
   リ
                    Exchange Server

                    その他業務サーバー
                                           5
業務サービスの構成 ~ IEの場合
※ブラウザコントロールも同様
                           業務サービス
                           (WEBサイト)
認証基盤に直接アクセス          認証
  する必要は無い
                             ここが大問題!

                 クラウド
                 オンプレミス

                            認証基盤


                      認証   業務サービス
                           (WEBサイト)

                                       6
業務サービスの構成 ~ SL アプリの場合
①              業務サービス
                        (SOAP/REST)
認証基盤に直接アクセス        認証
  する必要は無い
                            ここが問題!

              クラウド
              オンプレミス

                          認証基盤


                   認証   業務サービス
                        (SOAP/REST)

                                      7
業務サービスの構成 ~ SL アプリの場合
②              業務サービス
                  (SOAP/REST)
            認可
                      認証基盤に直接アクセス
                        する必要は無い
         クラウド
         オンプレミス

             認証    認証基盤



            認可    業務サービス
                  (SOAP/REST)
                      認証基盤に直接アクセス
                        する必要は無い
                                    8
課題はなに?
1.   クラウドサービスとオンプレミス認証基盤の連携方法
     •   Windows Azure インスタンスと Active Directory の連携方法


2.   Windows Phone から認証基盤にアクセスする方法
     •   Silverlight アプリから Active Directory で認証する方法


3.   WEB サービスが Active Directory で認証されたアプリ
     ケーションを受け入れる方法
     •   WCFサービス が Active Directory の認証結果を受け入れる方法
         本日は時間の都合でここまでは解説できませんが、良質のサンプル
         が大量に存在します
                                                        9
Windows Azure インスタンスと
Active Directory の連携




                        10
Windows Azure Connect
   クラウドとオンプレミス間の仮想ネットワーク接続
   Windows Azure インスタンスが
    オンプレミスの一部になる




                        企業内システム


                                  11
Windows Azure Connect
どう使う?
   Windows   Azure   アプリがオンプレミスの SQL Server にアクセス
   Windows   Azure   インスタンスを Active Directory ドメインに参加
   Windows   Azure   アプリからファイル サーバーにアクセス
   Windows   Azure   アプリからオンプレミスのプリンターに印刷
   Windows   Azure   アプリ/OS を PowerShell でリモート管理




                                                         12
Windows Azure Connect の仕組み
•   「ロール」と「エンドポイントグループ」間を Relay を通して接続
    (IPv6 with IPSEC)
•   既存のネットワークも同時に使用可能
                        Role

               インスタンス   インスタンス   インスタンス

                                          Azure Connect
                        Relay             エンドポイント
                                          ソフトウェア
        Firewall



                   エンドポイント グループ
                                                          13
Windows Azure Connect を使用すると

                               業務サービス
                        認証        AD ドメインに参
認証基盤に直接アクセス
                                       加
  する必要は無い
                              Windows Azure Connect により社
                              内サーバーとの通信が可能に
                    クラウド
                    オンプレミス

                                 認証基盤

   Silverlight アプ
   リ mobile 9
   IE                    認証    業務サービス

                                                           14
Windows Azure Connect の設定方法
 1. ライセンス認証トークンを取得する




 2. ライセンス認証トークンをプロジェクトに埋め込む




 3. プロジェクトを Windows Azure にデプロイ
                                  15
4. オンプレミスのサーバーに Azure Connect エンドポイントソフトウェアをイ
   ンストール(Azure インスタンスには自動的にインストールされる)


                           オンプレミスのサーバー上で
                            こいつにアクセスすると
                         インストーラーがダウンロードされる




             インストールが完了すると、Azure Connect 専用の仮
             想ネットワークカードが作成され、Azure Connect リ
             レー
             サービスに接続される。
                                   要再起動

                                                16
5. オンプレミスのサーバーと Azure インスタンスをグルーピング
   ※グルーピングはプロジェクトのアップロードが完了してから




                    Azure Connect エンドポイントソフトウェアを
                    インストールしたサーバー



                    Azure Connect を有効にしたインスタンス



                  構成が完了すると「!」マークが消える


                                                   17
Active Directory ドメインに参加するには
 プロジェクトに必要情報を埋め込んでからデプロイする
 •   Microsoft.WindowsAzure.Plugins.Connect.EnableDomainJoin  ここで指定したドメインコント
 •   Microsoft.WindowsAzure.Plugins.Connect.DomainFQDN        ローラにエンドポイントソフト
 •                                                            ウェアをインストールしておく
     Microsoft.WindowsAzure.Plugins.Connect.DomainControllerFQDN
 •   Microsoft.WindowsAzure.Plugins.Connect.DomainAccountName
 •   Microsoft.WindowsAzure.Plugins.Connect.DomainPassword    encrypt する!




                                                                               18
パスワードの encrypt 方法
サービス証明書を使用し、PowerShell 等でパスワードを暗号化する
 1. Visual Studio コマンドプロンプトを「管理者権限」で起動
 2. サービス証明書を作成
   ① 証明書(.cer)ファイルとプライベートキーファイル( .pvk)ファイルを作成
      makecert -r -pe -n "CN=PwdEncCert”
      -sky exchange “PwdEncCert.cer” -sv “PwdEncCert.pvk"
   ② pvk と .cer から .pfx ファイルを作成する
      pvk2pfx -pvk “PwdEncCert.pvk“
       -spc “PwdEncCert.cer“ -pfx “PwdEncCert.pfx“ -pi <パスワード>
 3. 作成した .pfx ファイルを当該 Azure インスタンスのサービス証明書として
    アップロード



                                                                 19
5. 作成した .cer ファイルを開発環境にインストール
   ※インストールした場所を覚えておくこと!(例えば CurrentUserMy)

6. PowerShell コンソールからの操作
    ① インストールした証明書の Thumbprint を取得
     PS C:> cd cert:CurrentUserMy
     PS cert:CurrentUsermy> dir
     Thumbprint                                 Subject
     ----------                                 -------
     F8ACE------------------------FB827AC61A3   CN=127.0.0.1, O=TESTING ONLY, OU=W.
     EB805------------------------842E095355B   CN=www.fabrikamshipping.com
     66EBD87D67398CD8FEA41E931B00BB98B8F06B06   CN=PwdEncCert
     ・
     ・
     PS cert:LocalMachinemy> cd c:
     PS C:>

                                                                                      20
② Thumbprint を使用して暗号化
  PS   C:>   $PlainPassword = “<パスワード>"
  PS   C:>   $thumbprint = “<Thumbprint>"
  PS   C:>   $AzureCert = get-item cert:LocalMachineMY$thumbprint
  PS   C:>   [Reflection.Assembly]::LoadWithPartialName("System.Security")
  PS   C:>   $pass = [Text.Encoding]::UTF8.GetBytes($PlainPassword)
  PS   C:>   $content = new-object Security.Cryptography.Pkcs.ContentInfo –argumentList (,$pass)
  PS   C:>   $env = new-object Security.Cryptography.Pkcs.EnvelopedCms $content
  PS   C:>   $env.Encrypt((new-object System.Security.Cryptography.Pkcs.CmsRecipient($AzureCert)))
  PS   C:>   [Convert]::ToBase64String($env.Encode())

  MIIBlAYJKoZIhvcNAQcDoIIBhTCCAYECAQAxggFFMIIBQQIBADApMBUxEzARBxxxxAMTClB3c0VuY0N
  lcnQCEF/PzJ/f6bOxxxxPlIhq7rUwDQYJKoZIhvcNAQEBBQAEggEAqkWA5vT7A8K8dvaxQOKWG5Oegq
  eERbgzw2SOYwh9UqAyIMhEAm44YwV8DrYMykIMPJnwODV8f8M4M7FjRGJ9rrDjHJSf8W9DOJtsavEdZ
  xG9gDEoZ3lfrjP/CvppnSh3Kxxxxxxxxxxxx3UONXGZNyBrA2hz+LcTbLs8BKFUDLlP++iearfPoQ2
  6X0EcSnn6ImlkaRcJ7A0wh/TzZTtsaqA1I/2uF47hNlUSz0f55nGJloQUldSsf3L/NvtnjHmFNEiVLR
  pqgxxxxdzG9qA1LxWbxv9uDk09ObP6MFCQNg627v3FTHIVkUv2vcirOS1Su9QLpSInLq8352kUegoUj
  AzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECKgNvWGg707FgBDhojvrH17/nTKwlY23cPzs

  PS C:>

                                                                                                      21
7. 暗号化したパスワードを
   Microsoft.WindowsAzure.Plugins.Connect.DomainPassword にセット

8. 使用した証明書の Thumbprint をプロジェクトにセット




                                                                22
Azure インスタンスがドメイン参加するまでの流れ

 1. プロジェクトを展開
 2. オンプレミスにエンドポイントソフトウェアをインストール
 3. インスタンスとエンドポイントをグループ化

   約 Azure インスタンス側の Azure Connect エンドポイントソフトウェ
   15 アが
   分 ドメインコントローラと通信ができることを確認後、自動的にドメ
      イン参加が行われる(再起動有)

 4. ドメイン参加完了
   インスタンスが複数ある場合には、全てのインスタンスがドメインに参
                  加する


                                                 23
IIS で Windows 認証を有効にすると

Widows Azure 上のインスタンス




                          24
(参考)Windows Phone から社内ファイルサーバーにアクセス
 Windows Azure Connect を使用してアクセス

                                 WCF サービス

       社内 AD による認証




                                            WEBDAV
                 Azure Connect




                                     企業内ネットワーク
                                                     25
SSL と Windows Phone
 Windows Phone に規定でインストールされている Root Certificate
 詳細は http://msdn.microsoft.com/en-us/library/gg521150(v=VS.92).aspx

 AOL (United States)                 RSA Security (United States)
 Comodo (United States)              SECOM Trust Systems Co. Ltd (Japan)
 DigiCert (United States)            Taiwan-CA Inc. (Taiwan)
 Entrust (Canada)                    TrustCenter (Germany)
 GlobalSign (United Kingdom)         Trustwave (United States)
 GoDaddy (United States)             VeriSign (United States)
 Keynectis (France)                  VeriSign Business (United States)
 QuoVadis (Bermuda)



                                                                           26
自己署名証明書の取り扱い
https://~ にアクセスしたときに証明書をインストールすることはできない

               • 証明書を p7b 形式で保存
               • http アクセス可能な場所で公開


         そこで




   毎回表示されて
    うっとうしい

               WCF を使用する場合には特に重要!!
               証明書がインストールされていないと「There was no endpoint listening」エラー
                                                                       27
Silverlight アプリから
Active Directory で認証する方法




                           28
Windows Phone と認証
                             本日のテーマはこれ
           ライブラリ                             Identity Provider
                                                    Active
        SL.IdentityModel
                                                  Directory
      Windows Live Connect
                                                Windows Live
               SDK

        Facebook C# SDK                           Facebook

                             Windows Azure
      SL.Phone.Federation    AppFabric ACS
                                                   Google




                                                                 29
Windows Phone と Active Directory
• System.DirectoryServce がサポートされていない
   – Active Directory に直接アクセスできない
   – 何らかのサービスを介して認証の代行を依頼する必要がある


                                           AD DS
                        認証


                  利用                  認証

                                   認証代行
                                   サービス


                                                   30
Windows Phone と Active Directory Federation Service

               WS-Trust(SOAP)      AD FS           AD DS
              ① UserID/Password             ② 認証

            ⑤ セキュリティトークン                   ③ 属性

                                  ④ 属性に署名


① AD FS にはドメインのユーザーIDとパスワードを渡す(もちろん SSL)
② AD 認証は AD FS が代行
③ AD DS からユーザーの属性が返される(どんな属性を返すかはAD FSに定義されている)
④ AD FS は「属性(クレーム)」に署名をしてセキュリティートークン(SAML アサーション)
  を生成
⑤ WP アプリにはセキュリティトークンが返される

                                                           31
セキュリティトークンの使い道
            WS-Trust(SOAP)      AD FS           AD DS
           ① UserID/Password             ② 認証

          ⑤ セキュリティトークン                  ③ 属性

                               ④ 属性に署名     信頼

                                        ⑦ 認可

            ⑥ セキュリティトークン

                                               業務アプリ
⑥ アプリケーションにセキュリティトークンを送付
⑦ アプリケーションはセキュリティトークンを参照して「認可」

                                                        32
クレーム とは
    アプリケーションに渡すユーザー自身の属性
    ユーザーのロールを表現しアクセス認可に使用される




                                33
セキュリティ トークン/アサーション
   パッケージ化されたクレーム
   発行者(オーソリティ)の署名によって信頼性を担保
   発行者とセキュリティトークン利用者は事前に信頼関係を結んでおく
            セキュリティトークン/アサーション




                                      34
AD FS とは                                                                                   Domain Service
                                                                                    Lightweight Directory Service
 • Active Directory 5兄弟 の五男                                                             Certificate Service
 • AD 認証されたユーザーに対してセキュリティトーク                                                          Rights Management Service
   ンを発行する(セキュリティトークンサービス:STS)                                                            Federation Service

                     社内ネットワーク                               DMZ

         AD DS         構成DB       AD FS                  AD FS PROXY
                        cluster




                                                                     load balance
                                          load balance
          認証              or
                      standalon
     AD DS or
     SQL Server or
                      e                                                               Internet
     AD LDS

                          or
                        WID
         クレーム
          ストア
                        構成DB        STS                    R-PROXY
                                                                                                                    35
AD FS のセットアップ
 • 正確には Active Directory Federation Service 2.0
 • 最新版は WEB からダウンロード
     http://www.microsoft.com/downloads/ja-jp/details.aspx?FamilyID=118C3588-
     9070-426A-B655-6CEC0A92C10B
          ADFS ダウンロード                         検索
 •   サポートしている OS
      •   Windows   Server 2008 Datacenter/
      •   Windows   Server 2008 Enterprise/
      •   Windows   Server 2008 R2/
      •   Windows   Server 2008 R2 Datacenter/
      •   Windows   Server 2008 R2 Enterprise/
      •   Windows   Server 2008 R2 Foundation/
      •   Windows   Server 2008 R2 Standard/
      •   Windows   Server 2008 Service Pack 2/
      •   Windows   Server 2008 Standard/
      •   Windows   Small Business Server 2008 Premium/
      •   Windows   Small Business Server 2008 Standard
 •   Active Directory ドメイン 必須

                                                                                36
Windows Phone から AD FS を利用するには
          SL.IdentityModel ライブラリ
          •   Identity Developer TrainingKit 2010 April に含まれている
              http://www.microsoft.com/download/en/details.aspx?id=14347
          •   PC 用 Silverlight 版なので移植が必要
               Claims                    ProtocolsWSTrust
               ├ Claim.cs                 ├ IRequestCredentials.cs
               ├ ClaimCollection.cs       ├ IssueCompletedEventArgs.cs
               ├ ClaimsIdentity.cs        ├ IssuedTokenHeader.cs
               ├ ClaimsPrincipal.cs       ├ IWSTrustContract.cs
               ├ ClaimType.cs             ├ RequestedSecurityToken.cs
               ├ IClaimsIdentity.cs       ├ RequestSecurityToken.cs
               └ IClaimsPrincipal.cs      ├ RequestSecurityTokenResponse.cs
                                          ├ UsernameCredentials.cs
               Services                  ├ WindowsCredentials.cs
               └ TokenCache.cs            ├ WSTrust13Constants.cs
                                          ├ WSTrust13ResponseSerializer.cs
                                          ├ WSTrustBinding.cs
                                          ├ WSTrustBindingUsernameMixed.cs
                                          ├ WSTrustBindingWindows.cs
                                          ├ WSTrustClient.cs
                                          ├ WSTrustRequestBodyWriter.cs
                                          └ WSTrustSerializationHelper.cs
                                                                              37
SL.IdentityModel ライブラリの移植手順
 1. プロジェクトを作成
     • テンプレート
       :Windows Phone クラスライブラリ(Visual C#)
     • 名前
       :(例)WP.IdentityModel とか

 2. 参照設定の追加
     • System.Runtime.Serialization
     • System.ServiceModel
     • System.Xml.Linq

 3. SL.IdentityModel から ソースをひたすらコピペ




                                            38
SL.IdentityModel を使用したアプリの作成
1. 必要情報の収集
     AD FS のエンドポイント
       https://<ADFSサーバー>/adfs/services/trust/13/usernamemixed
     スコープ(ApplyTo、業務アプリの識別名)
       (例)https://www.contoso.com/

2. 参照設定の追加
    • 移植したライブラリのプロジェクトを選択




3. using の追加
    • using SL.IdentityModel.Claims;
    • using SL.IdentityModel.Protocols.WSTrust;
    • using SL.IdentityModel.Services;
                                                                 39
4. 認証&セキュリティトークンの取得
WSTrustClient _client;

private void _btnLogin_Click(object sender, RoutedEventArgs e)
     { RequestST(); }

private void RequestST()
     {

         _client = new WSTrustClient(                             WS-Trustクライアントを作成
           new WSTrustBindingUsernameMixed(),
           new EndpointAddress("https://tfadfs.tf.com/adfs/services/trust/13/usernamemixed"),
           new UsernameCredentials(<             >, <          >));

         var rst = new RequestSecurityToken(WSTrust13Constants.KeyTypes.Bearer)
         {
              AppliesTo = new EndpointAddress("https://www.contoso.com/")
          };
         _client.IssueCompleted += client_IssueCompleted;
         _client.IssueAsync(rst);                         セキュリティトークンを非同期で要求
     }                     非同期で実行
                                                                                                40
void client_IssueCompleted(object sender, IssueCompletedEventArgs e)
    {
        _client.IssueCompleted -= client_IssueCompleted;

        if (e.Error == null)
        {
           Globals.RSTR = e.Result;
           MessageBox.Show( e.Result );
        }
        else
        {
            MessageBox.Show(e.Error.Message);
            _btnLogin.IsEnabled = true;
        }
    }



                                                                       41
セキュリティトークン(SAML アサーション)
<saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="_b6d37acb-381c-4160-a712-d3eceee44ef5"
Issuer="http://tfadfs.tf.com/adfs/services/trust" IssueInstant="2011-11-28T00:16:18.445Z"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion">
<saml:Conditions NotBefore="2011-11-28T00:16:18.445Z" NotOnOrAfter="2011-11-28T01:16:18.445Z“>
<saml:AudienceRestrictionCondition>
<saml:Audience>https://www.contoso.com/</saml:Audience>
</saml:AudienceRestrictionCondition></saml:Conditions>
<saml:AttributeStatement>
<saml:Subject><saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod></saml:SubjectConfirmation></saml:Subj
ect>
<saml:Attribute AttributeName="name" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
<saml:AttributeValue>西城秀樹</saml:AttributeValue></saml:Attribute>
<saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims">
<saml:AttributeValue>administrator@tf.com</saml:AttributeValue></saml:Attribute>
<saml:Attribute AttributeName="companyname" AttributeNamespace="http://schemas.tf.com">
<saml:AttributeValue>マイクロソフト</saml:AttributeValue></saml:Attribute>
<saml:Attribute AttributeName="department"AttributeNamespace="http://shcemas.tf.com">
<saml:AttributeValue>エバンジェリズムグループ</saml:AttributeValue></saml:Attribute></saml:AttributeStatement>
<saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password" AuthenticationInstant="2011-11-
28T00:16:18.023Z">
<saml:Subject><saml:SubjectConfirmation><saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMetho
d></saml:SubjectConfirmation></saml:Subject></saml:AuthenticationStatement>




                                                                                                                                 42
つづき
<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/2001/04/xmldsig-more#rsa-sha256" />
<ds:Reference URI="#_b6d37acb-381c-4160-a712-d3eceee44ef5">
<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/2001/04/xmlenc#sha256" />
<ds:DigestValue>mT+IdNIJq6No0jKKX034keFNO+0HZ3dIbnOrDnzfnI4=</ds:DigestValue></ds:Reference></ds:SignedInfo>
<ds:SignatureValue>fQ/ju362tt3EGKAMOtlfFwNAa7+dZoLftbNv1wyFjkytnPaD/BlxASXkDf2KeyBG8lxIpPDBTJFczME8A3gpHKBLuFIlURldx4V5ZuVkxz
ltLqjInHs/ectAzbagSHhDVYlRuo3F8zGoV2YFH4ZHme1snqPk0ArB60W5vh8jnAvmN7VsMovmmwPupMc5d4WLeXKH7/2Piz8Q2gM2sQb818lPhYzP9V80gJPPyDX
6gbbn+QUjcnITv8nohZOutophufy54498Ul6EnBfFuEUToaZZCVfh6O5NaO/gXHp4XvNgWkRNbNM1IVYBHiOrQyTPrVrccLpYKMxed1j3yJS/Nw==</ds:Signatu
reValue>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<X509Data>
<X509Certificate>MIIC1jCCAb6gAwIBAgIQX4B1j9QgNZ9GI3IsMJ/+vTANBgkqhkiG9w0BAQsFADAnMSUwIwYDVQQDExxBREZTIFNpZ25pbmcgLSB0ZmFkZnMu
dGYuY29tMB4XDTExMDQxNTA1NDIwM1oXDTEyMDQxNDA1NDIwM1owJzElMCMGA1UEAxMcQURGUyBTaWduaW5nIC0gdGZhZGZzLnRmLmNvbTCCASIwDQYJKoZIhvcNA
QEBBQADggEPADCCAQoCggEBALcp//XyPz6m9F5ok4ebtuz7XsIdesuvlze5OgN2FD4PkAykETXHRgeheAq1TtbTN/nIiTy11kKgEAseyUSfvMGJarf49vui+zNcy3
7t+tbrBGdx+MRhuncTb7+O8FKJ3Wg/q9h8e10hq3VeEoxhzd4Ghdl1R4DfJYf10PztfFeQPvoD3FJNgca7v1BB1gRtUEEykmJvSoZFt18mhk1l+9Bsk5SJyEZaZc4
M99ubqriVzzgDMZBa02+9Y6nmyy0P+sNrPnMSg031IulcGH+Zp8/W2B2ojHx3HisNkhYc8cQPYtLVoYanZ/qLG6hdqphM5TFi67QubdqclAE7MAoOx50CAwEAATAN
BgkqhkiG9w0BAQsFAAOCAQEAsU3E1uCieRjMAeVel29h9/oHLXy8hoGiy7iG3cgQBysA3Mlm3BjrLII4ze2JEZ74U8t5dk4K3K04emDuy4JhKpOP/iZXRN56UEuhI
idFfsHi/k9PLXPEgG1AJnueK52u71xj8noyPJ1EsYwVWTqm5emN5CVDEpJtPFJmsdrBviChFaOO9XURrz2rcp+TAt56cDJKFqj39aKv5YAYWBiSj0UP5cSnXxI7F3
lk7kNS19L2HdhPliXFoXI+doQ6ynOJrVUSqVMIbww7nOehWxI6TyWo9+A6TTl3LmpdNYyFYXJFjNI0JMKBm1U6yEvXEApI15LQ8IfJtSjPHoIPBHfSig==</X509C
ertificate>
</X509Data>
</KeyInfo>
</ds:Signature>
</saml:Assertion>

                                                                                                                                43
5. クレームの抽出
var sb = new StringBuilder(128);
IClaimsPrincipal n = TokenHandler.Convert(Globals.RSTR);
n.ClaimsIdentity.Claims.ToList().ForEach(vc => sb.AppendFormat("{0}n {1}nn", vc.ClaimType, vc.Value));
MessageBox.Show(sb.ToString());

public static class TokenHandler
{
     private static XNamespace ASSERTION_NAMESPACE = "urn:oasis:names:tc:SAML:1.0:assertion";
     private const string CLAIM_VALUE_TYPE = "http://www.w3.org/2001/XMLSchema#string"; // bit of a hack

    public static IClaimsPrincipal Convert(RequestSecurityTokenResponse rstr)
    {
      return new ClaimsPrincipal( GetClaimsIdentity( rstr ) );
    }

    private static ClaimsIdentity GetClaimsIdentity(RequestSecurityTokenResponse rstr)
    {
                                         次ページ
     }

}
                                                                                                            44
private static ClaimsIdentity GetClaimsIdentity( RequestSecurityTokenResponse rstr )
      {
        XDocument responseDoc = XDocument.Parse(rstr.RequestedSecurityToken.RawToken);
        XElement attStatement = responseDoc.Element(ASSERTION_NAMESPACE +
"Assertion").Element(ASSERTION_NAMESPACE + "AttributeStatement");

        var issuer = responseDoc.Root.Attribute("Issuer").Value;
        ClaimCollection claims = new ClaimCollection();

        foreach (var c in attStatement.Elements(ASSERTION_NAMESPACE + "Attribute"))
        {
           string attrName = c.Attribute("AttributeName").Value;
           string attrNamespace = c.Attribute("AttributeNamespace").Value;
           string claimType = attrNamespace + "/" + attrName;

            foreach (var val in c.Elements(ASSERTION_NAMESPACE + "AttributeValue"))
            {
               claims.Add(new Claim(issuer, issuer, claimType, val.Value, CLAIM_VALUE_TYPE));
            }
        }

        return new ClaimsIdentity(claims);
    }
                                                                                                45
スコープについて
 • AD FS 上では「証明書利用者信頼」として定義されている
 • セキュリティトークンを渡す相手(業務アプリ)のこと
 • 定義されていないスコープにはセキュリティトークンは発行されない

                               AD FS           AD DS
          WS-Trust(SOAP)
          ① UserID/Password             ② 認証


         ⑤ セキュリティトークン                  ③ 属性

                              ④ 属性に署名
                                         信頼
                                       ⑦ 認可

          ⑥ セキュリティトークン

                                               業務アプリ


                                                       46
47
クレームの定義について
• クレームとは業務アプリケーションの「主張(要求)」
• 業務アプリケーションに渡すクレームは AD FS で制御する
• Active Directory や SQL Server に格納されている属性情報をクレームと
  して送出可能
• 属性情報は AD FS 内で結合や置換が可能(姓 + 名 = 氏名 等)




                                                     48
サーバー証明書のインポート
SSL を要求するサービスの場合、証明書がインストールされていないとエンドポ
イントを見つけられない(There was no endpoint listening エラー)


private void _btnInstallCert_Click(object sender, RoutedEventArgs e)
 {
    CertP7BPath = “http://<WEBサーバー>/<証明書のファイル名>.p7b";
    WebBrowserTask webBrowserTask = new WebBrowserTask();
    webBrowserTask.Uri = new Uri(CertP7BPath, UriKind.Absolute);
    webBrowserTask.Show();
 }




                                                                       49
資格情報の再利用
•   認証のために入力した資格情報(UserID/Password)は分離ストレージに保存して再利用す
    ることが可能
•   保存の際には暗号化することが望ましい


           ID/Password 入力

                  ID/Password を送信

                        認証結果



             次回以降は起動したらすぐ
                 に認証開始

                                                       50
DPAPI を使用した暗号化/復号化
いったんByte型に変換してから暗号化する

 using System.Text;
 using System.Security.Cryptography;

 //暗号化
 byte[] PinByte = Encoding.UTF8.GetBytes(<文字列>);
 byte[] ProtectedPinByte = ProtectedData.Protect(PinByte, null);

 //復号化
 byte[] PinByte = ProtectedData.Unprotect(ProtectedPinByte, null);
 n = Encoding.UTF8.GetString(PinByte, 0, PinByte.Length);




                                                                     51
暗号化した文字列を参照するには
Base64 にエンコード
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
if (store.FileExists(encryptpin.FilePath_username) )
   {
     MessageBox.Show(
          System.Convert.ToBase64String(encryptpin.ReadPinFromFile(encryptpin.FilePath_username))
          );
    }
else
   {
      MessageBox.Show("                                 ");
    }




                                                                                                    52
※WCFサービス が Active Directory の認証結果を受け入れる方法


セキュリティトークンに対応した
WCF サービスの作成方法

               本日は解説いたしません




                                            53
セキュリティトークンを受け取るメリット
                            WS-Trust(SOAP)      AD FS           AD DS
                                                         ② 認証
• 情報の正当性が担保されている           ① UserID/Password

   • STS による署名            ⑤ セキュリティトークン                   ③ 属性

   • STS との信頼関係                                ④ 属性に署名

                                                        ⑦ 認可

                           ⑥ セキュリティトークン


• クレームによりユーザーを認可(承認)できる                                         業務アプリ

   • AD グループのメンバーシップ
   • 所属部署や役職 など    アプリが固有に持つ必要が無い


• アプリケーションの動作に必要な情報を受け取れる
   • 氏名
   • メールアドレス など   取りに行く必要が無い



                                                                        54
Identity Developer Training Kit 2010 April
 http://www.microsoft.com/download/en/details.aspx?id=1434
 7

                             EXERCISE 1:
                              USING WINDOWS IDENTITY FOUNDATION TO HANDLE
                             AUTHENTICATION AND AUTHORIZATION IN A WCF SERVICE

                             EXERCISE 2:
                              ACCEPTING TOKENS FROM AN ACTIVE DIRECTORY FEDERATION
                             SERVICES (ADFS) STS

                             EXERCISE 3:
                              INVOKING A WCF SERVICE ON THE BACKEND VIA DELEGATED
                             ACCESS




                                                                                     55
まとめ




      56
まとめ
 • クラウドのミドルウェアは要注目です
   • Windows Azure Connect
   • Windows Azure AppFabric ACS
   • Windows Azure Sync Service など

 • AD FS は AD DS の安全装置でもあります
    • アプリが直接 AD DS にアクセスするのを防げます

 • この分野は「知ってる者勝ち」です


                                     57
リソース
 安納のBLOG
 http://blogs.technet.com/junichia/

 本セミナーのまとめサイト
 http://blogs.technet.com/b/junichia/p/wp7_and_ad.aspx




                                                         58
The information herein is for informational purposes only and represents the current view of
                                          Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to
                                          changing market conditions, it should not be interpreted to be a commitment on the part of
                                          Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the
                                          date of this presentation.

                                          MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO
                                          THE INFORMATION IN THIS PRESENTATION.




© 2011 Microsoft Corporation.

All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.

Mais conteúdo relacionado

Mais procurados

Azure AD による Web API の 保護
Azure AD による Web API の 保護 Azure AD による Web API の 保護
Azure AD による Web API の 保護 junichi anno
 
20180918_ops on azure-main
20180918_ops on azure-main20180918_ops on azure-main
20180918_ops on azure-mainJun Misawa
 
Microsoft Azure のセキュリティ
Microsoft Azure のセキュリティMicrosoft Azure のセキュリティ
Microsoft Azure のセキュリティjunichi anno
 
Azure vm usacase and value.1.0.20.0618
Azure vm usacase and value.1.0.20.0618 Azure vm usacase and value.1.0.20.0618
Azure vm usacase and value.1.0.20.0618 Ayumu Inaba
 
この先生きのこるためのログ管理
この先生きのこるためのログ管理この先生きのこるためのログ管理
この先生きのこるためのログ管理Miho Yamamoto
 
Azure container as a service v0.1.19.1213
Azure container as a service v0.1.19.1213Azure container as a service v0.1.19.1213
Azure container as a service v0.1.19.1213Ayumu Inaba
 
Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理
Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理
Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理Yuki Hattori
 
Azure AD によるリソースの保護 how to protect and govern resources under the Azure AD
Azure AD によるリソースの保護 how to protect and govern resources under the Azure ADAzure AD によるリソースの保護 how to protect and govern resources under the Azure AD
Azure AD によるリソースの保護 how to protect and govern resources under the Azure ADjunichi anno
 
Microsoft Azure の概要と最近のアップデート(2016年6月25日)
Microsoft Azure の概要と最近のアップデート(2016年6月25日)Microsoft Azure の概要と最近のアップデート(2016年6月25日)
Microsoft Azure の概要と最近のアップデート(2016年6月25日)kekekekenta
 
DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計
DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計
DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計junichi anno
 
リソーステンプレート入門
リソーステンプレート入門リソーステンプレート入門
リソーステンプレート入門junichi anno
 
こわくない!Azure 運用管理
こわくない!Azure 運用管理こわくない!Azure 運用管理
こわくない!Azure 運用管理Miho Yamamoto
 
4/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.1
4/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.14/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.1
4/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.1junichi anno
 
今さら聞けないMicrosoft azure仮想マシン入門
今さら聞けないMicrosoft azure仮想マシン入門今さら聞けないMicrosoft azure仮想マシン入門
今さら聞けないMicrosoft azure仮想マシン入門Trainocate Japan, Ltd.
 
詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編
詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編
詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編Yusuke Kodama
 

Mais procurados (18)

Azure Key Vault
Azure Key VaultAzure Key Vault
Azure Key Vault
 
Azure AD による Web API の 保護
Azure AD による Web API の 保護 Azure AD による Web API の 保護
Azure AD による Web API の 保護
 
20180918_ops on azure-main
20180918_ops on azure-main20180918_ops on azure-main
20180918_ops on azure-main
 
Microsoft Azure のセキュリティ
Microsoft Azure のセキュリティMicrosoft Azure のセキュリティ
Microsoft Azure のセキュリティ
 
Azure vm usacase and value.1.0.20.0618
Azure vm usacase and value.1.0.20.0618 Azure vm usacase and value.1.0.20.0618
Azure vm usacase and value.1.0.20.0618
 
Sql azure入門
Sql azure入門Sql azure入門
Sql azure入門
 
この先生きのこるためのログ管理
この先生きのこるためのログ管理この先生きのこるためのログ管理
この先生きのこるためのログ管理
 
Azure container as a service v0.1.19.1213
Azure container as a service v0.1.19.1213Azure container as a service v0.1.19.1213
Azure container as a service v0.1.19.1213
 
Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理
Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理
Azure SecOps! Azure Key Vaultを用いたクラウドのキー管理
 
Azure AD によるリソースの保護 how to protect and govern resources under the Azure AD
Azure AD によるリソースの保護 how to protect and govern resources under the Azure ADAzure AD によるリソースの保護 how to protect and govern resources under the Azure AD
Azure AD によるリソースの保護 how to protect and govern resources under the Azure AD
 
Microsoft Azure の概要と最近のアップデート(2016年6月25日)
Microsoft Azure の概要と最近のアップデート(2016年6月25日)Microsoft Azure の概要と最近のアップデート(2016年6月25日)
Microsoft Azure の概要と最近のアップデート(2016年6月25日)
 
DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計
DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計
DevSecOps: セキュリティ問題に迅速に対応するためのパイプライン設計
 
リソーステンプレート入門
リソーステンプレート入門リソーステンプレート入門
リソーステンプレート入門
 
こわくない!Azure 運用管理
こわくない!Azure 運用管理こわくない!Azure 運用管理
こわくない!Azure 運用管理
 
4/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.1
4/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.14/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.1
4/5 ADFS 2.0 を使用して Windows Azure との SSO を実現しよう V1.1
 
Non-coding! Azure
Non-coding! AzureNon-coding! Azure
Non-coding! Azure
 
今さら聞けないMicrosoft azure仮想マシン入門
今さら聞けないMicrosoft azure仮想マシン入門今さら聞けないMicrosoft azure仮想マシン入門
今さら聞けないMicrosoft azure仮想マシン入門
 
詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編
詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編
詳説!Azure AD 条件付きアクセス - 動作の仕組みを理解する編
 

Semelhante a Windows Phone で Active Directory 認証 2011.12.1版

Apps for office オンプレミスとクラウド
Apps for office オンプレミスとクラウドApps for office オンプレミスとクラウド
Apps for office オンプレミスとクラウドHirotada Watanabe
 
Cloud で Active Directory を活用するには
Cloud で Active Directory を活用するにはCloud で Active Directory を活用するには
Cloud で Active Directory を活用するにはjunichi anno
 
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~Trainocate Japan, Ltd.
 
IDaaS を正しく活用するための認証基盤設計
IDaaS を正しく活用するための認証基盤設計IDaaS を正しく活用するための認証基盤設計
IDaaS を正しく活用するための認証基盤設計Trainocate Japan, Ltd.
 
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップS07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップMicrosoft Azure Japan
 
【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...
【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...
【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...日本マイクロソフト株式会社
 
Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~
Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~ Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~
Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~ Daisuke Masubuchi
 
Hybrid Azure AD Join 動作の仕組みを徹底解説
Hybrid Azure AD Join 動作の仕組みを徹底解説Hybrid Azure AD Join 動作の仕組みを徹底解説
Hybrid Azure AD Join 動作の仕組みを徹底解説Yusuke Kodama
 
AWS Black Belt Techシリーズ Amazon Workspaces
AWS Black Belt Techシリーズ  Amazon WorkspacesAWS Black Belt Techシリーズ  Amazon Workspaces
AWS Black Belt Techシリーズ Amazon WorkspacesAmazon Web Services Japan
 
20190201 Cloud Native Kansai AKS Azure
20190201 Cloud Native Kansai AKS Azure20190201 Cloud Native Kansai AKS Azure
20190201 Cloud Native Kansai AKS AzureIssei Hiraoka
 
20140605_じどうかの窓口_CloudBees_Jenkins
20140605_じどうかの窓口_CloudBees_Jenkins20140605_じどうかの窓口_CloudBees_Jenkins
20140605_じどうかの窓口_CloudBees_JenkinsSHIFT Inc.
 
Windows 開発者のための Dev&Ops on AWS
Windows 開発者のための Dev&Ops on AWSWindows 開発者のための Dev&Ops on AWS
Windows 開発者のための Dev&Ops on AWSAmazon Web Services Japan
 
Interoperability of webassembly with javascript
Interoperability of webassembly with javascriptInteroperability of webassembly with javascript
Interoperability of webassembly with javascriptTakao Tetsuro
 
20140725 tf azure_pack_slideshare
20140725 tf azure_pack_slideshare20140725 tf azure_pack_slideshare
20140725 tf azure_pack_slideshareosamut
 
AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済
AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済
AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済junichi anno
 
INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~
INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~
INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~decode2016
 
OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤
OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤
OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤Daisuke Nishino
 
Java/Android開発者のためのWindows Azure入門 (パート2)
Java/Android開発者のためのWindows Azure入門 (パート2)Java/Android開発者のためのWindows Azure入門 (パート2)
Java/Android開発者のためのWindows Azure入門 (パート2)Naoki (Neo) SATO
 

Semelhante a Windows Phone で Active Directory 認証 2011.12.1版 (20)

Apps for office オンプレミスとクラウド
Apps for office オンプレミスとクラウドApps for office オンプレミスとクラウド
Apps for office オンプレミスとクラウド
 
Cloud で Active Directory を活用するには
Cloud で Active Directory を活用するにはCloud で Active Directory を活用するには
Cloud で Active Directory を活用するには
 
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~
IDaaS を正しく活用するための認証基盤設計 ~Azure Active Directory の構成パターン詳細~
 
IDaaS を正しく活用するための認証基盤設計
IDaaS を正しく活用するための認証基盤設計IDaaS を正しく活用するための認証基盤設計
IDaaS を正しく活用するための認証基盤設計
 
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップS07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
S07 Azure バックアップを利用したオンプレミス Windows Server のバックアップ
 
【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...
【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...
【Japan Partner Conference 2019】『君、明日から Azure 担当ね!』 VMware パートナー様必見! 明日からできる最新...
 
Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~
Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~ Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~
Microsoft Azure ~ Web開発 & モバイル開発者向け情報 ~
 
【de:code 2020】 Azure インフラ 最新アップデート!!
【de:code 2020】 Azure インフラ 最新アップデート!!【de:code 2020】 Azure インフラ 最新アップデート!!
【de:code 2020】 Azure インフラ 最新アップデート!!
 
Hybrid Azure AD Join 動作の仕組みを徹底解説
Hybrid Azure AD Join 動作の仕組みを徹底解説Hybrid Azure AD Join 動作の仕組みを徹底解説
Hybrid Azure AD Join 動作の仕組みを徹底解説
 
AWS Black Belt Techシリーズ Amazon Workspaces
AWS Black Belt Techシリーズ  Amazon WorkspacesAWS Black Belt Techシリーズ  Amazon Workspaces
AWS Black Belt Techシリーズ Amazon Workspaces
 
20190201 Cloud Native Kansai AKS Azure
20190201 Cloud Native Kansai AKS Azure20190201 Cloud Native Kansai AKS Azure
20190201 Cloud Native Kansai AKS Azure
 
20140605_じどうかの窓口_CloudBees_Jenkins
20140605_じどうかの窓口_CloudBees_Jenkins20140605_じどうかの窓口_CloudBees_Jenkins
20140605_じどうかの窓口_CloudBees_Jenkins
 
Windows 開発者のための Dev&Ops on AWS
Windows 開発者のための Dev&Ops on AWSWindows 開発者のための Dev&Ops on AWS
Windows 開発者のための Dev&Ops on AWS
 
Interoperability of webassembly with javascript
Interoperability of webassembly with javascriptInteroperability of webassembly with javascript
Interoperability of webassembly with javascript
 
【de:code 2020】 Azure インフラ 最新アップデート!!
【de:code 2020】 Azure インフラ 最新アップデート!!【de:code 2020】 Azure インフラ 最新アップデート!!
【de:code 2020】 Azure インフラ 最新アップデート!!
 
20140725 tf azure_pack_slideshare
20140725 tf azure_pack_slideshare20140725 tf azure_pack_slideshare
20140725 tf azure_pack_slideshare
 
AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済
AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済
AD FS 2 と ACS v2 による Windows azure_step_bystep_v2.2_update1_noanime.pptx.アニメ削除済
 
INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~
INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~
INF-005_ハイブリッド クラウド環境でのネットワークとセキュリティ ~Azure とのプライベート接続~
 
OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤
OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤
OSSによるマッシュアップ&サービス化を実現するOpen棟梁サービス開発基盤
 
Java/Android開発者のためのWindows Azure入門 (パート2)
Java/Android開発者のためのWindows Azure入門 (パート2)Java/Android開発者のためのWindows Azure入門 (パート2)
Java/Android開発者のためのWindows Azure入門 (パート2)
 

Mais de junichi anno

V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...
V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...
V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...junichi anno
 
Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~
Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~
Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~junichi anno
 
個人情報を守るための アプリケーション設計(概要)
個人情報を守るためのアプリケーション設計(概要)個人情報を守るためのアプリケーション設計(概要)
個人情報を守るための アプリケーション設計(概要)junichi anno
 
IoT のセキュリティアーキテクチャと実装モデル on Azure
IoT のセキュリティアーキテクチャと実装モデル on AzureIoT のセキュリティアーキテクチャと実装モデル on Azure
IoT のセキュリティアーキテクチャと実装モデル on Azurejunichi anno
 
Azureの管理権限について
Azureの管理権限について Azureの管理権限について
Azureの管理権限について junichi anno
 
Azure Active Directory 1枚資料 20151125版
Azure Active Directory 1枚資料 20151125版Azure Active Directory 1枚資料 20151125版
Azure Active Directory 1枚資料 20151125版junichi anno
 
File Server on Azure IaaS
File Server on Azure IaaSFile Server on Azure IaaS
File Server on Azure IaaSjunichi anno
 
Windows File Service 総復習-Windows Server 2012 R2編 第1版
Windows File Service 総復習-Windows Server 2012 R2編 第1版Windows File Service 総復習-Windows Server 2012 R2編 第1版
Windows File Service 総復習-Windows Server 2012 R2編 第1版junichi anno
 
Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...
Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...
Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...junichi anno
 
勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版
勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版
勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版junichi anno
 
Hyper-V を Windows PowerShell から管理する
Hyper-V を Windows PowerShell から管理するHyper-V を Windows PowerShell から管理する
Hyper-V を Windows PowerShell から管理するjunichi anno
 
Vdi を より使いやすいインフラにするためのセキュリティ設計
Vdi を より使いやすいインフラにするためのセキュリティ設計Vdi を より使いやすいインフラにするためのセキュリティ設計
Vdi を より使いやすいインフラにするためのセキュリティ設計junichi anno
 
最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現
最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現
最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現junichi anno
 
SaaS としての IDM の役割
SaaS としての IDM の役割SaaS としての IDM の役割
SaaS としての IDM の役割junichi anno
 
クラウドにおける Windows Azure Active Directory の役割
クラウドにおける Windows Azure Active Directory の役割クラウドにおける Windows Azure Active Directory の役割
クラウドにおける Windows Azure Active Directory の役割junichi anno
 
Dynamic Access Control 演習編
Dynamic Access Control 演習編Dynamic Access Control 演習編
Dynamic Access Control 演習編junichi anno
 
Dynamic Access Control 解説編
Dynamic Access Control 解説編Dynamic Access Control 解説編
Dynamic Access Control 解説編junichi anno
 
Shared Nothing Live Migration で重要な「委任」について
Shared Nothing Live Migration で重要な「委任」についてShared Nothing Live Migration で重要な「委任」について
Shared Nothing Live Migration で重要な「委任」についてjunichi anno
 
仮想化した DC を PowerShell で複製する
仮想化した DC を PowerShell で複製する仮想化した DC を PowerShell で複製する
仮想化した DC を PowerShell で複製するjunichi anno
 
Active Directory 最新情報 2012.8.31 暫定版
Active Directory 最新情報 2012.8.31 暫定版Active Directory 最新情報 2012.8.31 暫定版
Active Directory 最新情報 2012.8.31 暫定版junichi anno
 

Mais de junichi anno (20)

V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...
V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...
V1.1 CD03 Azure Active Directory B2C/B2B コラボレーションによる Customer Identity and Ac...
 
Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~
Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~
Azure ad の導入を検討している方へ ~ active directory の構成パターンと正しい認証方式の選択~
 
個人情報を守るための アプリケーション設計(概要)
個人情報を守るためのアプリケーション設計(概要)個人情報を守るためのアプリケーション設計(概要)
個人情報を守るための アプリケーション設計(概要)
 
IoT のセキュリティアーキテクチャと実装モデル on Azure
IoT のセキュリティアーキテクチャと実装モデル on AzureIoT のセキュリティアーキテクチャと実装モデル on Azure
IoT のセキュリティアーキテクチャと実装モデル on Azure
 
Azureの管理権限について
Azureの管理権限について Azureの管理権限について
Azureの管理権限について
 
Azure Active Directory 1枚資料 20151125版
Azure Active Directory 1枚資料 20151125版Azure Active Directory 1枚資料 20151125版
Azure Active Directory 1枚資料 20151125版
 
File Server on Azure IaaS
File Server on Azure IaaSFile Server on Azure IaaS
File Server on Azure IaaS
 
Windows File Service 総復習-Windows Server 2012 R2編 第1版
Windows File Service 総復習-Windows Server 2012 R2編 第1版Windows File Service 総復習-Windows Server 2012 R2編 第1版
Windows File Service 総復習-Windows Server 2012 R2編 第1版
 
Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...
Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...
Active Directory のクラウド武装化計画 V2~"AD on Azure IaaS" or "Windows Azure Active Di...
 
勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版
勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版
勉強会キット Windows Server 2012 R2 評価版 BYOD 編 v2 20131020 版
 
Hyper-V を Windows PowerShell から管理する
Hyper-V を Windows PowerShell から管理するHyper-V を Windows PowerShell から管理する
Hyper-V を Windows PowerShell から管理する
 
Vdi を より使いやすいインフラにするためのセキュリティ設計
Vdi を より使いやすいインフラにするためのセキュリティ設計Vdi を より使いやすいインフラにするためのセキュリティ設計
Vdi を より使いやすいインフラにするためのセキュリティ設計
 
最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現
最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現
最新Active DirectoryによるIDMaaSとハイブリッド認証基盤の実現
 
SaaS としての IDM の役割
SaaS としての IDM の役割SaaS としての IDM の役割
SaaS としての IDM の役割
 
クラウドにおける Windows Azure Active Directory の役割
クラウドにおける Windows Azure Active Directory の役割クラウドにおける Windows Azure Active Directory の役割
クラウドにおける Windows Azure Active Directory の役割
 
Dynamic Access Control 演習編
Dynamic Access Control 演習編Dynamic Access Control 演習編
Dynamic Access Control 演習編
 
Dynamic Access Control 解説編
Dynamic Access Control 解説編Dynamic Access Control 解説編
Dynamic Access Control 解説編
 
Shared Nothing Live Migration で重要な「委任」について
Shared Nothing Live Migration で重要な「委任」についてShared Nothing Live Migration で重要な「委任」について
Shared Nothing Live Migration で重要な「委任」について
 
仮想化した DC を PowerShell で複製する
仮想化した DC を PowerShell で複製する仮想化した DC を PowerShell で複製する
仮想化した DC を PowerShell で複製する
 
Active Directory 最新情報 2012.8.31 暫定版
Active Directory 最新情報 2012.8.31 暫定版Active Directory 最新情報 2012.8.31 暫定版
Active Directory 最新情報 2012.8.31 暫定版
 

Último

【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 

Último (10)

【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 

Windows Phone で Active Directory 認証 2011.12.1版

  • 1. 企業利用者のための Windows Phone アプリ開発 ~業務アプリケーションの配信と管理を実装する Part II アプリケーションに 認証機能を実装する 2011.12.1 V1.01 日本マイクロソフト株式会社 エバンジェリスト 安納 順一(あんのう じゅんいち) http://blogs.technet.com/junichia/ twitter @junichia
  • 2. Agenda 1. クラウドサービスとオンプレミス認証基盤の連携方法 • Windows Azure インスタンスと Active Directory の連携方法 2. Windows Phone から認証基盤にアクセスする方法 • Silverlight アプリから Active Directory で認証する方法 3. WEB サービスが Active Directory で認証されたアプリケーションを 受け入れる方法 • WCFサービス が Active Directory の認証結果を受け入れる方法 お時間の都合上、この部分の詳しい解説は割愛させていただきます 2
  • 4. 復習:業務サービスの構成 1. 業務サービスの場所 ① オンプレミス いずれの場合も認証 ② 一部または全部がクラウド 基盤との連携が重要 2. 業務サービスへの接続アプリ ① Internet Explorer 認証基盤との ② Silverlight アプリ 連携方法が異なる 4
  • 5. 業務アプリの「使い勝手」を考えれば... IE9 Mobile クラウドアプリ Active Directory ファミ リ SharePoint Server Silverlight アプ リ Exchange Server その他業務サーバー 5
  • 6. 業務サービスの構成 ~ IEの場合 ※ブラウザコントロールも同様 業務サービス (WEBサイト) 認証基盤に直接アクセス 認証 する必要は無い ここが大問題! クラウド オンプレミス 認証基盤 認証 業務サービス (WEBサイト) 6
  • 7. 業務サービスの構成 ~ SL アプリの場合 ① 業務サービス (SOAP/REST) 認証基盤に直接アクセス 認証 する必要は無い ここが問題! クラウド オンプレミス 認証基盤 認証 業務サービス (SOAP/REST) 7
  • 8. 業務サービスの構成 ~ SL アプリの場合 ② 業務サービス (SOAP/REST) 認可 認証基盤に直接アクセス する必要は無い クラウド オンプレミス 認証 認証基盤 認可 業務サービス (SOAP/REST) 認証基盤に直接アクセス する必要は無い 8
  • 9. 課題はなに? 1. クラウドサービスとオンプレミス認証基盤の連携方法 • Windows Azure インスタンスと Active Directory の連携方法 2. Windows Phone から認証基盤にアクセスする方法 • Silverlight アプリから Active Directory で認証する方法 3. WEB サービスが Active Directory で認証されたアプリ ケーションを受け入れる方法 • WCFサービス が Active Directory の認証結果を受け入れる方法 本日は時間の都合でここまでは解説できませんが、良質のサンプル が大量に存在します 9
  • 11. Windows Azure Connect  クラウドとオンプレミス間の仮想ネットワーク接続  Windows Azure インスタンスが オンプレミスの一部になる 企業内システム 11
  • 12. Windows Azure Connect どう使う?  Windows Azure アプリがオンプレミスの SQL Server にアクセス  Windows Azure インスタンスを Active Directory ドメインに参加  Windows Azure アプリからファイル サーバーにアクセス  Windows Azure アプリからオンプレミスのプリンターに印刷  Windows Azure アプリ/OS を PowerShell でリモート管理 12
  • 13. Windows Azure Connect の仕組み • 「ロール」と「エンドポイントグループ」間を Relay を通して接続 (IPv6 with IPSEC) • 既存のネットワークも同時に使用可能 Role インスタンス インスタンス インスタンス Azure Connect Relay エンドポイント ソフトウェア Firewall エンドポイント グループ 13
  • 14. Windows Azure Connect を使用すると 業務サービス 認証 AD ドメインに参 認証基盤に直接アクセス 加 する必要は無い Windows Azure Connect により社 内サーバーとの通信が可能に クラウド オンプレミス 認証基盤 Silverlight アプ リ mobile 9 IE 認証 業務サービス 14
  • 15. Windows Azure Connect の設定方法 1. ライセンス認証トークンを取得する 2. ライセンス認証トークンをプロジェクトに埋め込む 3. プロジェクトを Windows Azure にデプロイ 15
  • 16. 4. オンプレミスのサーバーに Azure Connect エンドポイントソフトウェアをイ ンストール(Azure インスタンスには自動的にインストールされる) オンプレミスのサーバー上で こいつにアクセスすると インストーラーがダウンロードされる インストールが完了すると、Azure Connect 専用の仮 想ネットワークカードが作成され、Azure Connect リ レー サービスに接続される。 要再起動 16
  • 17. 5. オンプレミスのサーバーと Azure インスタンスをグルーピング ※グルーピングはプロジェクトのアップロードが完了してから Azure Connect エンドポイントソフトウェアを インストールしたサーバー Azure Connect を有効にしたインスタンス 構成が完了すると「!」マークが消える 17
  • 18. Active Directory ドメインに参加するには プロジェクトに必要情報を埋め込んでからデプロイする • Microsoft.WindowsAzure.Plugins.Connect.EnableDomainJoin ここで指定したドメインコント • Microsoft.WindowsAzure.Plugins.Connect.DomainFQDN ローラにエンドポイントソフト • ウェアをインストールしておく Microsoft.WindowsAzure.Plugins.Connect.DomainControllerFQDN • Microsoft.WindowsAzure.Plugins.Connect.DomainAccountName • Microsoft.WindowsAzure.Plugins.Connect.DomainPassword encrypt する! 18
  • 19. パスワードの encrypt 方法 サービス証明書を使用し、PowerShell 等でパスワードを暗号化する 1. Visual Studio コマンドプロンプトを「管理者権限」で起動 2. サービス証明書を作成 ① 証明書(.cer)ファイルとプライベートキーファイル( .pvk)ファイルを作成 makecert -r -pe -n "CN=PwdEncCert” -sky exchange “PwdEncCert.cer” -sv “PwdEncCert.pvk" ② pvk と .cer から .pfx ファイルを作成する pvk2pfx -pvk “PwdEncCert.pvk“ -spc “PwdEncCert.cer“ -pfx “PwdEncCert.pfx“ -pi <パスワード> 3. 作成した .pfx ファイルを当該 Azure インスタンスのサービス証明書として アップロード 19
  • 20. 5. 作成した .cer ファイルを開発環境にインストール ※インストールした場所を覚えておくこと!(例えば CurrentUserMy) 6. PowerShell コンソールからの操作 ① インストールした証明書の Thumbprint を取得 PS C:> cd cert:CurrentUserMy PS cert:CurrentUsermy> dir Thumbprint Subject ---------- ------- F8ACE------------------------FB827AC61A3 CN=127.0.0.1, O=TESTING ONLY, OU=W. EB805------------------------842E095355B CN=www.fabrikamshipping.com 66EBD87D67398CD8FEA41E931B00BB98B8F06B06 CN=PwdEncCert ・ ・ PS cert:LocalMachinemy> cd c: PS C:> 20
  • 21. ② Thumbprint を使用して暗号化 PS C:> $PlainPassword = “<パスワード>" PS C:> $thumbprint = “<Thumbprint>" PS C:> $AzureCert = get-item cert:LocalMachineMY$thumbprint PS C:> [Reflection.Assembly]::LoadWithPartialName("System.Security") PS C:> $pass = [Text.Encoding]::UTF8.GetBytes($PlainPassword) PS C:> $content = new-object Security.Cryptography.Pkcs.ContentInfo –argumentList (,$pass) PS C:> $env = new-object Security.Cryptography.Pkcs.EnvelopedCms $content PS C:> $env.Encrypt((new-object System.Security.Cryptography.Pkcs.CmsRecipient($AzureCert))) PS C:> [Convert]::ToBase64String($env.Encode()) MIIBlAYJKoZIhvcNAQcDoIIBhTCCAYECAQAxggFFMIIBQQIBADApMBUxEzARBxxxxAMTClB3c0VuY0N lcnQCEF/PzJ/f6bOxxxxPlIhq7rUwDQYJKoZIhvcNAQEBBQAEggEAqkWA5vT7A8K8dvaxQOKWG5Oegq eERbgzw2SOYwh9UqAyIMhEAm44YwV8DrYMykIMPJnwODV8f8M4M7FjRGJ9rrDjHJSf8W9DOJtsavEdZ xG9gDEoZ3lfrjP/CvppnSh3Kxxxxxxxxxxxx3UONXGZNyBrA2hz+LcTbLs8BKFUDLlP++iearfPoQ2 6X0EcSnn6ImlkaRcJ7A0wh/TzZTtsaqA1I/2uF47hNlUSz0f55nGJloQUldSsf3L/NvtnjHmFNEiVLR pqgxxxxdzG9qA1LxWbxv9uDk09ObP6MFCQNg627v3FTHIVkUv2vcirOS1Su9QLpSInLq8352kUegoUj AzBgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECKgNvWGg707FgBDhojvrH17/nTKwlY23cPzs PS C:> 21
  • 22. 7. 暗号化したパスワードを Microsoft.WindowsAzure.Plugins.Connect.DomainPassword にセット 8. 使用した証明書の Thumbprint をプロジェクトにセット 22
  • 23. Azure インスタンスがドメイン参加するまでの流れ 1. プロジェクトを展開 2. オンプレミスにエンドポイントソフトウェアをインストール 3. インスタンスとエンドポイントをグループ化 約 Azure インスタンス側の Azure Connect エンドポイントソフトウェ 15 アが 分 ドメインコントローラと通信ができることを確認後、自動的にドメ イン参加が行われる(再起動有) 4. ドメイン参加完了 インスタンスが複数ある場合には、全てのインスタンスがドメインに参 加する 23
  • 24. IIS で Windows 認証を有効にすると Widows Azure 上のインスタンス 24
  • 25. (参考)Windows Phone から社内ファイルサーバーにアクセス Windows Azure Connect を使用してアクセス WCF サービス 社内 AD による認証 WEBDAV Azure Connect 企業内ネットワーク 25
  • 26. SSL と Windows Phone Windows Phone に規定でインストールされている Root Certificate 詳細は http://msdn.microsoft.com/en-us/library/gg521150(v=VS.92).aspx AOL (United States) RSA Security (United States) Comodo (United States) SECOM Trust Systems Co. Ltd (Japan) DigiCert (United States) Taiwan-CA Inc. (Taiwan) Entrust (Canada) TrustCenter (Germany) GlobalSign (United Kingdom) Trustwave (United States) GoDaddy (United States) VeriSign (United States) Keynectis (France) VeriSign Business (United States) QuoVadis (Bermuda) 26
  • 27. 自己署名証明書の取り扱い https://~ にアクセスしたときに証明書をインストールすることはできない • 証明書を p7b 形式で保存 • http アクセス可能な場所で公開 そこで 毎回表示されて うっとうしい WCF を使用する場合には特に重要!! 証明書がインストールされていないと「There was no endpoint listening」エラー 27
  • 29. Windows Phone と認証 本日のテーマはこれ ライブラリ Identity Provider Active SL.IdentityModel Directory Windows Live Connect Windows Live SDK Facebook C# SDK Facebook Windows Azure SL.Phone.Federation AppFabric ACS Google 29
  • 30. Windows Phone と Active Directory • System.DirectoryServce がサポートされていない – Active Directory に直接アクセスできない – 何らかのサービスを介して認証の代行を依頼する必要がある AD DS 認証 利用 認証 認証代行 サービス 30
  • 31. Windows Phone と Active Directory Federation Service WS-Trust(SOAP) AD FS AD DS ① UserID/Password ② 認証 ⑤ セキュリティトークン ③ 属性 ④ 属性に署名 ① AD FS にはドメインのユーザーIDとパスワードを渡す(もちろん SSL) ② AD 認証は AD FS が代行 ③ AD DS からユーザーの属性が返される(どんな属性を返すかはAD FSに定義されている) ④ AD FS は「属性(クレーム)」に署名をしてセキュリティートークン(SAML アサーション) を生成 ⑤ WP アプリにはセキュリティトークンが返される 31
  • 32. セキュリティトークンの使い道 WS-Trust(SOAP) AD FS AD DS ① UserID/Password ② 認証 ⑤ セキュリティトークン ③ 属性 ④ 属性に署名 信頼 ⑦ 認可 ⑥ セキュリティトークン 業務アプリ ⑥ アプリケーションにセキュリティトークンを送付 ⑦ アプリケーションはセキュリティトークンを参照して「認可」 32
  • 33. クレーム とは  アプリケーションに渡すユーザー自身の属性  ユーザーのロールを表現しアクセス認可に使用される 33
  • 34. セキュリティ トークン/アサーション  パッケージ化されたクレーム  発行者(オーソリティ)の署名によって信頼性を担保  発行者とセキュリティトークン利用者は事前に信頼関係を結んでおく セキュリティトークン/アサーション 34
  • 35. AD FS とは Domain Service Lightweight Directory Service • Active Directory 5兄弟 の五男 Certificate Service • AD 認証されたユーザーに対してセキュリティトーク Rights Management Service ンを発行する(セキュリティトークンサービス:STS) Federation Service 社内ネットワーク DMZ AD DS 構成DB AD FS AD FS PROXY cluster load balance load balance 認証 or standalon AD DS or SQL Server or e Internet AD LDS or WID クレーム ストア 構成DB STS R-PROXY 35
  • 36. AD FS のセットアップ • 正確には Active Directory Federation Service 2.0 • 最新版は WEB からダウンロード http://www.microsoft.com/downloads/ja-jp/details.aspx?FamilyID=118C3588- 9070-426A-B655-6CEC0A92C10B ADFS ダウンロード 検索 • サポートしている OS • Windows Server 2008 Datacenter/ • Windows Server 2008 Enterprise/ • Windows Server 2008 R2/ • Windows Server 2008 R2 Datacenter/ • Windows Server 2008 R2 Enterprise/ • Windows Server 2008 R2 Foundation/ • Windows Server 2008 R2 Standard/ • Windows Server 2008 Service Pack 2/ • Windows Server 2008 Standard/ • Windows Small Business Server 2008 Premium/ • Windows Small Business Server 2008 Standard • Active Directory ドメイン 必須 36
  • 37. Windows Phone から AD FS を利用するには SL.IdentityModel ライブラリ • Identity Developer TrainingKit 2010 April に含まれている http://www.microsoft.com/download/en/details.aspx?id=14347 • PC 用 Silverlight 版なので移植が必要 Claims ProtocolsWSTrust ├ Claim.cs ├ IRequestCredentials.cs ├ ClaimCollection.cs ├ IssueCompletedEventArgs.cs ├ ClaimsIdentity.cs ├ IssuedTokenHeader.cs ├ ClaimsPrincipal.cs ├ IWSTrustContract.cs ├ ClaimType.cs ├ RequestedSecurityToken.cs ├ IClaimsIdentity.cs ├ RequestSecurityToken.cs └ IClaimsPrincipal.cs ├ RequestSecurityTokenResponse.cs ├ UsernameCredentials.cs Services ├ WindowsCredentials.cs └ TokenCache.cs ├ WSTrust13Constants.cs ├ WSTrust13ResponseSerializer.cs ├ WSTrustBinding.cs ├ WSTrustBindingUsernameMixed.cs ├ WSTrustBindingWindows.cs ├ WSTrustClient.cs ├ WSTrustRequestBodyWriter.cs └ WSTrustSerializationHelper.cs 37
  • 38. SL.IdentityModel ライブラリの移植手順 1. プロジェクトを作成 • テンプレート :Windows Phone クラスライブラリ(Visual C#) • 名前 :(例)WP.IdentityModel とか 2. 参照設定の追加 • System.Runtime.Serialization • System.ServiceModel • System.Xml.Linq 3. SL.IdentityModel から ソースをひたすらコピペ 38
  • 39. SL.IdentityModel を使用したアプリの作成 1. 必要情報の収集  AD FS のエンドポイント https://<ADFSサーバー>/adfs/services/trust/13/usernamemixed  スコープ(ApplyTo、業務アプリの識別名) (例)https://www.contoso.com/ 2. 参照設定の追加 • 移植したライブラリのプロジェクトを選択 3. using の追加 • using SL.IdentityModel.Claims; • using SL.IdentityModel.Protocols.WSTrust; • using SL.IdentityModel.Services; 39
  • 40. 4. 認証&セキュリティトークンの取得 WSTrustClient _client; private void _btnLogin_Click(object sender, RoutedEventArgs e) { RequestST(); } private void RequestST() { _client = new WSTrustClient( WS-Trustクライアントを作成 new WSTrustBindingUsernameMixed(), new EndpointAddress("https://tfadfs.tf.com/adfs/services/trust/13/usernamemixed"), new UsernameCredentials(< >, < >)); var rst = new RequestSecurityToken(WSTrust13Constants.KeyTypes.Bearer) { AppliesTo = new EndpointAddress("https://www.contoso.com/") }; _client.IssueCompleted += client_IssueCompleted; _client.IssueAsync(rst); セキュリティトークンを非同期で要求 } 非同期で実行 40
  • 41. void client_IssueCompleted(object sender, IssueCompletedEventArgs e) { _client.IssueCompleted -= client_IssueCompleted; if (e.Error == null) { Globals.RSTR = e.Result; MessageBox.Show( e.Result ); } else { MessageBox.Show(e.Error.Message); _btnLogin.IsEnabled = true; } } 41
  • 42. セキュリティトークン(SAML アサーション) <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="_b6d37acb-381c-4160-a712-d3eceee44ef5" Issuer="http://tfadfs.tf.com/adfs/services/trust" IssueInstant="2011-11-28T00:16:18.445Z" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"> <saml:Conditions NotBefore="2011-11-28T00:16:18.445Z" NotOnOrAfter="2011-11-28T01:16:18.445Z“> <saml:AudienceRestrictionCondition> <saml:Audience>https://www.contoso.com/</saml:Audience> </saml:AudienceRestrictionCondition></saml:Conditions> <saml:AttributeStatement> <saml:Subject><saml:SubjectConfirmation> <saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMethod></saml:SubjectConfirmation></saml:Subj ect> <saml:Attribute AttributeName="name" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims"> <saml:AttributeValue>西城秀樹</saml:AttributeValue></saml:Attribute> <saml:Attribute AttributeName="emailaddress" AttributeNamespace="http://schemas.xmlsoap.org/ws/2005/05/identity/claims"> <saml:AttributeValue>administrator@tf.com</saml:AttributeValue></saml:Attribute> <saml:Attribute AttributeName="companyname" AttributeNamespace="http://schemas.tf.com"> <saml:AttributeValue>マイクロソフト</saml:AttributeValue></saml:Attribute> <saml:Attribute AttributeName="department"AttributeNamespace="http://shcemas.tf.com"> <saml:AttributeValue>エバンジェリズムグループ</saml:AttributeValue></saml:Attribute></saml:AttributeStatement> <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:password" AuthenticationInstant="2011-11- 28T00:16:18.023Z"> <saml:Subject><saml:SubjectConfirmation><saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:bearer</saml:ConfirmationMetho d></saml:SubjectConfirmation></saml:Subject></saml:AuthenticationStatement> 42
  • 43. つづき <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/2001/04/xmldsig-more#rsa-sha256" /> <ds:Reference URI="#_b6d37acb-381c-4160-a712-d3eceee44ef5"> <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/2001/04/xmlenc#sha256" /> <ds:DigestValue>mT+IdNIJq6No0jKKX034keFNO+0HZ3dIbnOrDnzfnI4=</ds:DigestValue></ds:Reference></ds:SignedInfo> <ds:SignatureValue>fQ/ju362tt3EGKAMOtlfFwNAa7+dZoLftbNv1wyFjkytnPaD/BlxASXkDf2KeyBG8lxIpPDBTJFczME8A3gpHKBLuFIlURldx4V5ZuVkxz ltLqjInHs/ectAzbagSHhDVYlRuo3F8zGoV2YFH4ZHme1snqPk0ArB60W5vh8jnAvmN7VsMovmmwPupMc5d4WLeXKH7/2Piz8Q2gM2sQb818lPhYzP9V80gJPPyDX 6gbbn+QUjcnITv8nohZOutophufy54498Ul6EnBfFuEUToaZZCVfh6O5NaO/gXHp4XvNgWkRNbNM1IVYBHiOrQyTPrVrccLpYKMxed1j3yJS/Nw==</ds:Signatu reValue> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <X509Data> <X509Certificate>MIIC1jCCAb6gAwIBAgIQX4B1j9QgNZ9GI3IsMJ/+vTANBgkqhkiG9w0BAQsFADAnMSUwIwYDVQQDExxBREZTIFNpZ25pbmcgLSB0ZmFkZnMu dGYuY29tMB4XDTExMDQxNTA1NDIwM1oXDTEyMDQxNDA1NDIwM1owJzElMCMGA1UEAxMcQURGUyBTaWduaW5nIC0gdGZhZGZzLnRmLmNvbTCCASIwDQYJKoZIhvcNA QEBBQADggEPADCCAQoCggEBALcp//XyPz6m9F5ok4ebtuz7XsIdesuvlze5OgN2FD4PkAykETXHRgeheAq1TtbTN/nIiTy11kKgEAseyUSfvMGJarf49vui+zNcy3 7t+tbrBGdx+MRhuncTb7+O8FKJ3Wg/q9h8e10hq3VeEoxhzd4Ghdl1R4DfJYf10PztfFeQPvoD3FJNgca7v1BB1gRtUEEykmJvSoZFt18mhk1l+9Bsk5SJyEZaZc4 M99ubqriVzzgDMZBa02+9Y6nmyy0P+sNrPnMSg031IulcGH+Zp8/W2B2ojHx3HisNkhYc8cQPYtLVoYanZ/qLG6hdqphM5TFi67QubdqclAE7MAoOx50CAwEAATAN BgkqhkiG9w0BAQsFAAOCAQEAsU3E1uCieRjMAeVel29h9/oHLXy8hoGiy7iG3cgQBysA3Mlm3BjrLII4ze2JEZ74U8t5dk4K3K04emDuy4JhKpOP/iZXRN56UEuhI idFfsHi/k9PLXPEgG1AJnueK52u71xj8noyPJ1EsYwVWTqm5emN5CVDEpJtPFJmsdrBviChFaOO9XURrz2rcp+TAt56cDJKFqj39aKv5YAYWBiSj0UP5cSnXxI7F3 lk7kNS19L2HdhPliXFoXI+doQ6ynOJrVUSqVMIbww7nOehWxI6TyWo9+A6TTl3LmpdNYyFYXJFjNI0JMKBm1U6yEvXEApI15LQ8IfJtSjPHoIPBHfSig==</X509C ertificate> </X509Data> </KeyInfo> </ds:Signature> </saml:Assertion> 43
  • 44. 5. クレームの抽出 var sb = new StringBuilder(128); IClaimsPrincipal n = TokenHandler.Convert(Globals.RSTR); n.ClaimsIdentity.Claims.ToList().ForEach(vc => sb.AppendFormat("{0}n {1}nn", vc.ClaimType, vc.Value)); MessageBox.Show(sb.ToString()); public static class TokenHandler { private static XNamespace ASSERTION_NAMESPACE = "urn:oasis:names:tc:SAML:1.0:assertion"; private const string CLAIM_VALUE_TYPE = "http://www.w3.org/2001/XMLSchema#string"; // bit of a hack public static IClaimsPrincipal Convert(RequestSecurityTokenResponse rstr) { return new ClaimsPrincipal( GetClaimsIdentity( rstr ) ); } private static ClaimsIdentity GetClaimsIdentity(RequestSecurityTokenResponse rstr) { 次ページ } } 44
  • 45. private static ClaimsIdentity GetClaimsIdentity( RequestSecurityTokenResponse rstr ) { XDocument responseDoc = XDocument.Parse(rstr.RequestedSecurityToken.RawToken); XElement attStatement = responseDoc.Element(ASSERTION_NAMESPACE + "Assertion").Element(ASSERTION_NAMESPACE + "AttributeStatement"); var issuer = responseDoc.Root.Attribute("Issuer").Value; ClaimCollection claims = new ClaimCollection(); foreach (var c in attStatement.Elements(ASSERTION_NAMESPACE + "Attribute")) { string attrName = c.Attribute("AttributeName").Value; string attrNamespace = c.Attribute("AttributeNamespace").Value; string claimType = attrNamespace + "/" + attrName; foreach (var val in c.Elements(ASSERTION_NAMESPACE + "AttributeValue")) { claims.Add(new Claim(issuer, issuer, claimType, val.Value, CLAIM_VALUE_TYPE)); } } return new ClaimsIdentity(claims); } 45
  • 46. スコープについて • AD FS 上では「証明書利用者信頼」として定義されている • セキュリティトークンを渡す相手(業務アプリ)のこと • 定義されていないスコープにはセキュリティトークンは発行されない AD FS AD DS WS-Trust(SOAP) ① UserID/Password ② 認証 ⑤ セキュリティトークン ③ 属性 ④ 属性に署名 信頼 ⑦ 認可 ⑥ セキュリティトークン 業務アプリ 46
  • 47. 47
  • 48. クレームの定義について • クレームとは業務アプリケーションの「主張(要求)」 • 業務アプリケーションに渡すクレームは AD FS で制御する • Active Directory や SQL Server に格納されている属性情報をクレームと して送出可能 • 属性情報は AD FS 内で結合や置換が可能(姓 + 名 = 氏名 等) 48
  • 49. サーバー証明書のインポート SSL を要求するサービスの場合、証明書がインストールされていないとエンドポ イントを見つけられない(There was no endpoint listening エラー) private void _btnInstallCert_Click(object sender, RoutedEventArgs e) { CertP7BPath = “http://<WEBサーバー>/<証明書のファイル名>.p7b"; WebBrowserTask webBrowserTask = new WebBrowserTask(); webBrowserTask.Uri = new Uri(CertP7BPath, UriKind.Absolute); webBrowserTask.Show(); } 49
  • 50. 資格情報の再利用 • 認証のために入力した資格情報(UserID/Password)は分離ストレージに保存して再利用す ることが可能 • 保存の際には暗号化することが望ましい ID/Password 入力 ID/Password を送信 認証結果 次回以降は起動したらすぐ に認証開始 50
  • 51. DPAPI を使用した暗号化/復号化 いったんByte型に変換してから暗号化する using System.Text; using System.Security.Cryptography; //暗号化 byte[] PinByte = Encoding.UTF8.GetBytes(<文字列>); byte[] ProtectedPinByte = ProtectedData.Protect(PinByte, null); //復号化 byte[] PinByte = ProtectedData.Unprotect(ProtectedPinByte, null); n = Encoding.UTF8.GetString(PinByte, 0, PinByte.Length); 51
  • 52. 暗号化した文字列を参照するには Base64 にエンコード IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication(); if (store.FileExists(encryptpin.FilePath_username) ) { MessageBox.Show( System.Convert.ToBase64String(encryptpin.ReadPinFromFile(encryptpin.FilePath_username)) ); } else { MessageBox.Show(" "); } 52
  • 53. ※WCFサービス が Active Directory の認証結果を受け入れる方法 セキュリティトークンに対応した WCF サービスの作成方法 本日は解説いたしません 53
  • 54. セキュリティトークンを受け取るメリット WS-Trust(SOAP) AD FS AD DS ② 認証 • 情報の正当性が担保されている ① UserID/Password • STS による署名 ⑤ セキュリティトークン ③ 属性 • STS との信頼関係 ④ 属性に署名 ⑦ 認可 ⑥ セキュリティトークン • クレームによりユーザーを認可(承認)できる 業務アプリ • AD グループのメンバーシップ • 所属部署や役職 など アプリが固有に持つ必要が無い • アプリケーションの動作に必要な情報を受け取れる • 氏名 • メールアドレス など 取りに行く必要が無い 54
  • 55. Identity Developer Training Kit 2010 April http://www.microsoft.com/download/en/details.aspx?id=1434 7 EXERCISE 1: USING WINDOWS IDENTITY FOUNDATION TO HANDLE AUTHENTICATION AND AUTHORIZATION IN A WCF SERVICE EXERCISE 2: ACCEPTING TOKENS FROM AN ACTIVE DIRECTORY FEDERATION SERVICES (ADFS) STS EXERCISE 3: INVOKING A WCF SERVICE ON THE BACKEND VIA DELEGATED ACCESS 55
  • 56. まとめ 56
  • 57. まとめ • クラウドのミドルウェアは要注目です • Windows Azure Connect • Windows Azure AppFabric ACS • Windows Azure Sync Service など • AD FS は AD DS の安全装置でもあります • アプリが直接 AD DS にアクセスするのを防げます • この分野は「知ってる者勝ち」です 57
  • 58. リソース 安納のBLOG http://blogs.technet.com/junichia/ 本セミナーのまとめサイト http://blogs.technet.com/b/junichia/p/wp7_and_ad.aspx 58
  • 59. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.