aws-amplify / aws-amplify/amplify-cli

Support attributes for access control for Cognito identity providers

Open
#9,747 2 comments 3 reactions 0 assignees View on GitHub
auth feature-request p4
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### Before opening, please confirm:

- [X] I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-cli/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-cli/blob/master/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### How did you install the Amplify CLI?

yarn

### If applicable, what version of Node.js are you using?

_No response_

### Amplify CLI Version

7.6.19

### What operating system are you using?

Debian 11

### Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

After setting-up attributes for access control [ as described, in general, in [this AWS article](https://docs.aws.amazon.com/cognito/latest/developerguide/using-afac-with-cognito-identity-pools.html) but the change I made is described more specifically in [this comment of this issue](https://github.com/aws-amplify/amplify-js/issues/54#issuecomment-876455852) ] no user can sign in successfully into the app via the usual email/password Auth flow.

If I remove the attributes for access control first step, this issue goes away - users can sign in with no problems.

But adding attributes for access control causes the authentication to fail with errors (in Android) like "failed to federate token".

### Amplify Categories

auth

### Amplify Commands

Not applicable

### Describe the bug

After setting-up attributes for access control [ as described, in general, in [this AWS article](https://docs.aws.amazon.com/cognito/latest/developerguide/using-afac-with-cognito-identity-pools.html) but the change I made is described more specifically in [this comment of this issue](https://github.com/aws-amplify/amplify-js/issues/54#issuecomment-876455852), which you only need to follow up to and including step 2 ] no user can sign in successfully into the app via the usual email/password Auth flow.

If I remove the attributes for access control first step, this issue goes away - users can sign in with no problems.

But adding attributes for access control causes this issue to come up.

### Expected behavior

I expected that when you add attributes for access control to your project and map `cognitoId --> sub` using this mechanism, as described [here](https://docs.aws.amazon.com/cognito/latest/developerguide/using-afac-with-cognito-identity-pools.html) - this would not interfere with the Amplify Auth category's behavior. I expected these two - Amplify + attributes-for-access-control - could be used together in the same project.

### Reproduction steps

1. Set up a simple email / password auth Amplify app.
2. Add attributes for access control as described in [this comment of this issue](https://github.com/aws-amplify/amplify-js/issues/54#issuecomment-876455852). **NOTE you only need to follow up to and including step 2.**
3. Now try to have a signed-up user sign-in to your app and you'll get this issue.

### GraphQL schema(s)

```graphql
# Put schemas below this line

```

### Log output

```
# Put your logs below this line

```

### Additional information

This issue was originally showing up in an Amplify-Flutter app so I reported it in the `amplify-flutter` repository. However , at the time it was reported there, I did not know that it had nothing to do with Flutter. I now closed that old issue, but it has a lot of logs and other info that may be relevant to this one. [Here is the previous version of this issue with some more logs and details](https://github.com/aws-amplify/amplify-flutter/issues/1204).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.