1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Azure AD B2CでTOTPを使ってMFA認証をするときにハマったお話

Posted at

👇のサイトを参考にして作っていて自分がはまった内容を残しておきます。
参考:https://aadojo.alterbooth.com/entry/2020/12/19/110000?utm_source=feed
とても分かりやすく手順が書いてあるので大変参考になりました。

カスタムポリシーがアップロードできない?

SignUpOrSignin.xmlだけアップロードできなくて悩みました。

エラー内容

Validation failed: 1 validation error(s) found in policy "B2C_1A_TOTP_SIGNUP_SIGNIN" of tenant "{{your tenant}}.onmicrosoft.com".プロファイル 'AppFactor-VerifyTotpWebHook' のメタデータにキー 'ServiceUrl' が含まれています。このキーの URL は空か、無効な形式 '{Settings:VerifyAPI}' です。プロファイル 'AppFactor-VerifyTotpWebHook' のメタデータにキー 'ServiceUrl' が含まれています。このキーの URL は空か、無効な形式 '{Settings:VerifyAPI}' です。

原因

VerifyAPIで検索してTrustFrameworkExtensions.xmlを見ると、
👇のパラメータのSettings:VerifyAPIが書き換わってなかったです。

<Item Key="ServiceUrl">{Settings:VerifyAPI}</Item>

appsettings.jsonをみると、👇になっておりただの誤字だったみたいです。

"VelfiyAPI": "{{url}}"

解決策

正しいパラメータ名にしてもう一度 B2C Policy Buildをすることで解決しました。

AzureADB2Cでサインアップしてユーザーを追加できたがなんかエラーでた

Sorry, but we're having trouble signing you in.  We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, please try again.
  • カスタムポリシーなんかおかしいっぽい?
  • functionsの設定がおかしいっぽい?

原因1

appsettings.jsonで VerifyAPI, _GenerateAPI_を記述したが、functionsのベースエンドポイントをしていた

解決策1

各関数のエンドポイントを記述しないといけないんじゃないか?と気づいたので試してみた。

原因2

functionsのアプリケーション設定不足。

解決策2

local.settings.jsonに記載されてる情報にあるものを設定する

まとめ

無事Google Authenticatorから認証できるようになった。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?