11

認証コードと Azure AD B2C (クライアント側の oidc-client) を使用して Angular アプリの認証を設定しようとしましたが、Angular から次のエラーが発生しました。

ここに画像の説明を入力

B2C 監査ログを調べたところ、次のエラー メッセージが見つかりました。

Confidential Grant を引き換えるとき、クライアントは client_secret を送信する必要があります。

クライアント側の構成は次のとおりです。

const settings = {
  stsAuthority: 'https://supportodqqcdev.b2clogin.com/supportodqqcDev.onmicrosoft.com/v2.0/.well-known/openid-configuration?p=B2C_1_SignUpSignInOdqPlatine',
  clientId: '8447df5b-35a0-40a7-944f-5dcce87a2193',
  clientRoot: 'https://localhost:4200',
  scope: 'openid https://supportodqqcDev.onmicrosoft.com/platineclientdev/read',
};
this.userManager = new UserManager({
  authority: settings.stsAuthority,
  client_id: settings.clientId,
  redirect_uri: `${settings.clientRoot}/signin-callback`,
  scope: settings.scope,
  response_type: 'code',
  post_logout_redirect_uri: `${settings.clientRoot}/signout-callback`,
  automaticSilentRenew: true,
  silent_redirect_uri: `${settings.clientRoot}/assets/signin-silent-callback.html`,
});

上記の構成をローカルの IdentityServer インスタンスを使用するように切り替えると、すべてが正常に機能します。

どこで、またはどのようにこれを調査すべきかを教えてくれる人はいますか?

4

4 に答える 4