aws-amplify / aws-amplify/amplify-cli

aws-exports.js values not generated when using override.ts

Open
#13,887 1 comment 0 reactions 0 assignees View on GitHub
auth feature-request override
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

### How did you install the Amplify CLI?

npm

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

v16.20.2

### Amplify CLI Version

12.12.6

### What operating system are you using?

macOS

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

N/A

### Describe the bug

When setting OAuth values in `amplify/backend/auth//override.ts`, for example:

```
...
resources.userPoolClient.allowedOAuthFlows = ["code"];
resources.userPoolClient.allowedOAuthScopes = ["openid", "email", "profile"];
...
```

These values are not added to the `aws-exports.js` file.

If the values are added to `cli-inputs.json`, for example:

```
"oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"email\",\"openid\",\"profile\"],
```

The values do appear in `aws-exports.js`:

```
"oauth": {
...
"scope": [
"email",
"openid",
"profile"
],
"responseType": "code"
...
},
```

My understanding is these should be equivalent and `override.ts` is the more modern way of adding these settings.

### Expected behavior

aws-exports.js contains OAuth values when set from `override.ts` file

### Reproduction steps

1. Use `amplify/backend/auth//override.ts` to add OAuth properties
a. e.g.
```
resources.userPoolClient.allowedOAuthFlows = ["code"];
resources.userPoolClient.allowedOAuthScopes = ["openid", "email", "profile"];
```
2. Perform an `amplify push`
3. Notice `aws-exports.js` does not update

### Project Identifier

_No response_

### Log output

_No response_

### Additional information

I may be misunderstanding this, and if using `override.ts`, there's another way of acccessing the values that are set, instead of using `aws-exports.js`, but I'm not sure what this process is if it exists.

Thanks!

### Before submitting, please confirm:

- [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.

Contributor guide

Open the contributing guide

Research direction

Start with amplify/backend/auth//override.ts and compare how its OAuth values are handled with the cli-inputs.json path during amplify push. Inspect the generated aws-exports.js and verify whether allowedOAuthFlows and allowedOAuthScopes are carried through. Done means the documented override.ts reproduction produces the expected oauth responseType and scope values.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.