View
137
Download
1
Category
Preview:
Citation preview
Microsoft Tech Summit 2017本情報の内容(添付文書、リンク先などを含む)は、Microsoft Tech Summit 2017 開催日(2017 年 11 月 8日 - 9 日)時点のものであり、予告なく変更される場合があります。
Azure AD を使用して、
ここを誰から、どう守るか?
PowerShell
https://testpsfunction.azurewebsites.net/api/HttpTriggerPowerShell1?code=
TvXkdY2WKsev/wFkpyik09RZosbMmNsAe0gg8G3Tpsb8uV28BodA4Q==
Functions Key
PowerShell
Multitenant 設定
PowerShell
➢Function Key
URL は外部から隠ぺい
今回のターゲット
B2C
API
APIAzure APIManagement
Application
Subscription Key
https://xxxxxxxxx.portal.azure-api.net/signin-aad
③ ユーザーIDやロールによって API に対する権限を変えたい
APIAzure APIManagement
Application
<tenant ID>
<tenant ID>
<tenant ID>
• validate-jwt : JWT を検証して操作を承認する
➢ RS256 署名アルゴリズム ー OpenID 構成エンドポイントからキーを受け取る
• 認証ポリシー
https://docs.microsoft.com/ja-jp/azure/api-management/api-management-policy-reference
<policies>
<inbound>
<base />
<rewrite-uri template="/HttpTriggerPowerShell1?code=TvXkdY2WKsev/wFxxxxx==&name={username}" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
・・・・
<inbound>
<base />
<rewrite-uri template="/HttpTriggerPowerShell1?code=TvXkdY2WKsev/wFxxxxx==&name={username}" />
<validate-jwt
failed-validation-error-message="Unauthorized. Access token is missing or invalid."
failed-validation-httpcode="401" header-name="Authorization">
<openid-config url=“https://login.microsoftonline.com/テナントURL/.well-known/openid-configuration" />
<audiences><audience>チェックしたいアプリケーションのクライアントID</audience>
</audiences>
<required-claims><claim name=“チェックしたいクレーム名" match="all">
<value>クレーム内の値</value>
</claim>
</required-claims>
</validate-jwt>
<inbound>・・・・
<validate-jwt failed-validation-error-message="Unauthorized. Access token is missing or
invalid." failed-validation-httpcode="401" header-name="Authorization">
<openid-config
url="https://login.microsoftonline.com/pharaojp.onmicrosoft.com/.well-known/openid-
configuration" />
<audiences>
<audience>e55757f2-92ba-4422-8aa1-2ed25cbeece2</audience>
</audiences>
<required-claims>
<claim name="name" match="all">
<value>admin</value>
</claim>
</required-claims>
</validate-jwt>
IdPに応じた
プロトコルを実装
APIAzure APIManagement
Application
基本的に、プロトコルは意識しない
a
preview
preview
OIDC/OAuth2.0 で実装
a
preview
preview
Identity Experience Framework• SAML 2.0• OAuth 2.0• OIDC
Preview
Identity Experience Framework• SAML 2.0• OAuth 2.0• OIDC
Preview
c9687145-xxxx-xxxx-xxxxxxxxxxxx
.auth/login/aad/callback を追加
テナントID
控えておいた「アプリケーションID」を入力
https//sts.windwos.net/<テナントID>
https://testpsfunction.azurewebsites.net/api/HttpTriggerPo
werShell1?code=TvXkdY2WKsev/wFkpyik09RZosbMmNsAe
0gg8G3Tpsb8uV28BodA4Q==
Recommended