

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 組織内の個人が Quick Sight にアクセスしようとすると、「外部ログインは未承認」というメッセージが表示される
<a name="troubleshoot-webidentity-federation"></a>


|  | 
| --- |
|    対象者:  Amazon Quick 管理者  | 

組織内の個人が **AssumeRoleWithWebIdentity** を使用して Quick Sight にフェデレーションしている場合、Quick Sight は単一のロールベースのユーザーを単一の外部ログインにマッピングします。その個人が、最初にマッピングされたユーザーとは異なる外部ログイン (Amazon Cognito など) によって認証されることがあります。その場合、Quick Sight にアクセスできず、次の予期しないエラーメッセージが表示されます。

フェデレーションに使用される外部ログインは、Quick Sight ユーザーに対して許可されていません。

この問題のトラブルシューティングについては、次のセクションを参照してください。
+ [この問題が発生する理由](#troubleshoot-webidentity-federation-why)
+ [どうすれば解決できますか?](#troubleshoot-webidentity-federation-how)

## この問題が発生する理由
<a name="troubleshoot-webidentity-federation-why"></a>

### 単純化された Amazon Cognito フローを使用している
<a name="troubleshoot-webidentity-federation-why-Cognito-SSO-1"></a>

Amazon Cognito を使用して Quick Sight にフェデレーションする場合、シングルサインオン (IAM Identity Center) 設定で `CognitoIdentityCredentials` API オペレーションを使用して Quick Sight ロールを引き受けることができます。このメソッドは、Amazon Cognito ID プール内のすべてのユーザーを単一の Quick Sight ユーザーにマッピングし、Quick Sight ではサポートされていません。

代わりに `AssumeRoleWithWebIdentity` API オペレーションを使用して、ロールセッション名を指定することをお勧めします。

### 認証されていない Amazon Cognito ユーザーを使用しています。
<a name="troubleshoot-webidentity-federation-why-Cognito-SSO-2"></a>

Amazon Cognito IAM アイデンティティセンターは、Amazon Cognito ID プール内で認証されていないユーザー用に設定されています。Quick Sight ロールの信頼ポリシーは、次の例のように設定されます。

この設定により、一時的な Amazon Cognito ユーザーは、一意の Quick Sight ユーザーにマッピングされたロールセッションを引き受けることができます。認証されていない ID は一時的なものであるため、Quick Sight ではサポートされていません。

Quick Sight ではサポートされていないこの設定を使用しないことをお勧めします。Quick Sight の場合は、Amazon Cognito IAM Identity Center が認証されたユーザーを使用していることを確認します。

### 同じユーザー名属性を持つ Amazon Cognito ユーザーを削除して再作成した
<a name="troubleshoot-webidentity-federation-why-Cognito-user-delete"></a>

この場合、Quick Sight ユーザーにマッピングされている関連付けられた Amazon Cognito ユーザーを削除して再作成しました。新しく作成された Amazon Cognito ユーザーは、根底になるサブジェクトが異なります。ロールセッション名が Quick Sight ユーザーにマッピングされる方法によっては、セッション名が同じ Quick Sight ロールベースのユーザーに対応する場合があります。

`UpdateUser` API オペレーションを使用して、Quick Sight ユーザーを更新された Amazon Cognito ユーザーサブジェクトに再マッピングすることをお勧めします。詳細については、[UpdateUser API の例](#troubleshoot-webidentity-federation-solutions-updateuser)を参照してください。

### 複数の Amazon Cognito ユーザープールを 1 つの ID プール AWS アカウント と異なる にマッピングし、Quick Sight を使用する
<a name="troubleshoot-webidentity-federation-why-Cognito-multi-pools"></a>

の複数の Amazon Cognito ユーザープール AWS アカウント を 1 つの ID プールと Quick Sight にマッピングすることは、Quick Sight ではサポートされていません。

## どうすれば解決できますか?
<a name="troubleshoot-webidentity-federation-how"></a>

Quick Sight パブリック API オペレーションを使用して、ユーザーの外部ログイン情報を更新できます。次にその手順のオプションを説明します。

### RegisterUser を使用して外部ログイン情報を持つユーザーを作成する
<a name="troubleshoot-webidentity-federation-how-registeruser"></a>

外部ログインプロバイダーが Amazon Cognito の場合は、次の CLI コードを使用してユーザーを作成します。

```
aws quicksight register-user --aws-account-id {{account-id}} --namespace {{namespace}} --email {{user-email}} --user-role {{user-role}} --identity-type IAM
--iam-arn arn:aws:iam::{{account-id}}:role/{{cognito-associated-iam-role}} 
--session-name {{cognito-username}} --external-login-federation-provider-type COGNITO 
--external-login-id {{cognito-identity-id}} --region {{identity-region}}
```

`external-login-id` は Amazon Cognito ユーザーの ID を指定します。`<identity-region>:<cognito-user-sub>` の形式は、次の例のようにします。

```
aws quicksight register-user --aws-account-id 111222333 --namespace default --email cognito-user@amazon.com --user-role ADMIN --identity-type IAM
--iam-arn arn:aws:iam::111222333:role/CognitoQuickSightRole 
--session-name cognito-user --external-login-federation-provider-type COGNITO 
--external-login-id us-east-1:12345678-1234-1234-abc1-a1b1234567 --region us-east-1
```

外部ログインプロバイダーがカスタム OpenID Connect (OIDC) プロバイダーである場合は、次の CLI コードを使用してユーザーを作成します。

```
aws quicksight register-user --aws-account-id {{account-id}} --namespace {{namespace}}
--email {{user-email}} --user-role {{user-role}} --identity-type IAM
--iam-arn arn:aws:iam::{{account-id}}:role/{{identity-provider-associated-iam-role}} 
--session-name {{identity-username}} --external-login-federation-provider-type CUSTOM_OIDC 
--custom-federation-provider-url {{custom-identity-provider-url}} 
--external-login-id {{custom-provider-identity-id}} --region {{identity-region}}
```

以下に例を示します。

```
aws quicksight register-user --aws-account-id 111222333 --namespace default 
--email identity-user@amazon.com --user-role ADMIN --identity-type IAM
--iam-arn arn:aws:iam::111222333:role/CustomIdentityQuickSightRole
--session-name identity-user --external-login-federation-provider-type CUSTOM_OIDC 
--custom-federation-provider-url idp.us-east-1.amazonaws.com/us-east-1_ABCDE 
--external-login-id 12345678-1234-1234-abc1-a1b1234567 --region us-east-1
```

CLI `RegisterUser`での の使用の詳細については、*Amazon Quick API リファレンス*の[RegisterUser](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_RegisterUser.html)」を参照してください。

### DescribeUser を使用して、ユーザーの外部ログイン情報を確認する
<a name="troubleshoot-webidentity-federation-how-describeuser"></a>

ユーザーが外部ログインプロバイダーのロールベースのフェデレーティッドユーザーである場合は、次のコードに示されているように `DescribeUser`API オペレーションを使用して外部ログイン情報を確認します。

```
aws quicksight describe-user --aws-account-id {{account-id}}  --namespace {{namespace}}
--user-name {{identity-provider-associated-iam-role}}/{{identity-username}} 
--region {{identity-region}}
```

以下に例を示します。

```
aws quicksight describe-user --aws-account-id 111222333 --namespace default --user-name IdentityQuickSightRole/user --region us-west-2
```

結果には、外部ログイン情報フィールドがある場合、そのフィールドが含まれます。次に例を示します。

```
{
    "Status": 200,
    "User": {
        "Arn": "arn:aws:quicksight:us-east-1:111222333:user-default-IdentityQuickSightRole-user",
        "UserName": "IdentityQuickSightRole-user",
        "Email": "user@amazon.com",
        "Role": "ADMIN",
        "IdentityType": "IAM",
        "Active": true,
        "PrincipalId": "federated-iam-AROAAAAAAAAAAAAAA:user",
        "ExternalLoginFederationProviderType": "COGNITO",
        "ExternalLoginFederationProviderUrl": "cognito-identity.amazonaws.com",
        "ExternalLoginId": "us-east-1:123abc-1234-123a-b123-12345678a"
    },
    "RequestId": "12345678-1234-1234-abc1-a1b1234567"
}
```

CLI `DescribeUser`での の使用の詳細については、*「Amazon Quick API リファレンス*」の[DescribeUser](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DescribeUser.html)」を参照してください。

### UpdateUser を使用してユーザーの外部ログイン情報を更新する
<a name="troubleshoot-webidentity-federation-solutions-updateuser"></a>

場合によっては、ユーザーの外部ログイン情報で `DescribeUser` からの情報が正しくない、または外部ログイン情報が見つからないことがあります。その場合は、`UpdateUser` API オペレーションを使用して更新できます。以下の例を使用します。

Amazon Cognito ユーザーの場合、以下を使用します。

```
aws quicksight update-user --aws-account-id {{account-id}} --namespace {{namespace}} 
--user-name {{cognito-associated-iam-role}}/{{cognito-username}}
 --email {{user-email}} --role {{user-role}} 
--external-login-federation-provider-type COGNITO 
--external-login-id {{cognito-identity-id}} --region {{identity-region}}
```

次に例を示します。

```
aws quicksight update-user --aws-account-id 111222333 --namespace default 
--user-name CognitoQuickSightRole/cognito-user --email cognito-user@amazon.com 
--role ADMIN --external-login-federation-provider-type COGNITO 
--external-login-id us-east-1:12345678-1234-1234-abc1-a1b1234567 --region us-west-2
```

カスタム OIDC プロバイダーユーザーの場合、以下を使用します。

```
aws quicksight update-user --aws-account-id {{account-id}} --namespace {{namespace}} 
 --user-name {{identity-provider-associated-iam-role}}/{{identity-username}} 
--email {{user-email}} --role {{user-role}} 
--external-login-federation-provider-type CUSTOM_OIDC 
--custom-federation-provider-url {{custom-identity-provider-url}} 
--external-login-id {{custom-provider-identity-id}} --region {{identity-region}}
```

次に例を示します。

```
aws quicksight update-user --aws-account-id 111222333 --namespace default 
--user-name IdentityQuickSightRole/user --email user@amazon.com --role ADMIN 
--external-login-federation-provider-type CUSTOM_OIDC 
--custom-federation-provider-url idp.us-east-1.amazonaws.com/us-east-1_ABCDE 
 --external-login-id 123abc-1234-123a-b123-12345678a --region us-west-2
```

ユーザーの外部ログイン情報を削除するには、`NONE` `external login federation provider type` を使用します。次の CLI コマンドを使用して、外部ログイン情報を削除します。

```
aws quicksight update-user --aws-account-id {{account-id}} --namespace {{namespace}} 
 --user-name {{identity-provider-associated-iam-role}}/{{identity-username}} 
--email {{user-email}} --role {{user-role}}
--external-login-federation-provider-type NONE --region {{identity-region}}
```

以下に例を示します。

```
aws quicksight update-user --aws-account-id 111222333 --namespace default 
--user-name CognitoQuickSightRole/cognito-user --email cognito-user@amazon.com --role ADMIN --external-login-federation-provider-type NONE --region us-west-2
```

CLI `UpdateUser`での の使用の詳細については、*「Amazon Quick API リファレンス*」の[UpdateUser](https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdateUser.html)」を参照してください。