LoginSignup
0
0

More than 5 years have passed since last update.

Azure Active Directory B2Cでマルチテナントサンプルを動かしてみた(3)

Posted at

TL;DR
Azure Active Directory B2Cでマルチテナントサンプルを動かしてみた(2) 続き。

少し罠に陥ったのでちゃんと修正する。

整理

web.configの設定項目の意味は次の通り。

key value
ida:ClientId B2CのクライアントID
ida:Tenant B2Cのドメイン
ida:RedirectUri ローカルで動かすならhttps://localhost:44393/とか
ida:PostLogoutRedirectUri とりあえずida:RedirectUriと同じでよい
aad:Tenant サブスクリプション側のADドメイン
aad:ClientId ADのクライアントID
aad:ClientSecret ADのキー

ida:ClientId

image.png

ida:Tenant

image.png

ida:RedirectUri/ida:PostLogoutRedirectUri

https://localhost:44393/にしておいた。
AAD/AAD B2C/プロジェクト側の起動設定も44393ポートにしておかないと、どこかでこける。

aad:Tenant

image.png

aad:ClientId

image.png

aad:ClientSecret

image.png

変えちゃだめなとこ

B2CMultiTenant.Utilities.Constantsは何があっても書き換えちゃだめ。
だめだよ!

ローカルDBで使ってるので、安易に書き換えると痛い目を見る。

DBのデータソース

web.configData Source=の部分は、環境によって書き換える。

    <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\ProjectsV13;AttachDbFileName=|DataDirectory|\DB2CMultiTenant.mdf;Initial Catalog=B2CMultiTenant;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>

私の環境ではMSSQLLocalDBとなっていた。
確認方法は、コマンドプロンプトでsqllocaldb infoと打てばよい。
それすらダメならLocal DBが入っていないかも・・?


これで、デモと同じようにそれとなく動き始めた、はず。
ユーザー一覧とか動かないところについては別途検証する。
というか、デモでも動いてませんし。

以上。

0
0
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
0