Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for setting PreTokenGeneration to v2_0 for access token #13682

Open
2 tasks
Zhuohui-Li opened this issue Mar 31, 2024 · 1 comment
Open
2 tasks

Support for setting PreTokenGeneration to v2_0 for access token #13682

Zhuohui-Li opened this issue Mar 31, 2024 · 1 comment
Labels
auth Issues tied to the auth category of the CLI feature-request Request a new feature p4

Comments

@Zhuohui-Li
Copy link

Is this feature request related to a new or existing Amplify category?

auth

Is this related to another service?

cognito

Describe the feature you'd like to request

Currently, the amplify cli doesn't support configuring the PreTokenGeneration trigger to v2_0 directly through its configuration

Describe the solution you'd like

amplify update auth
Do you want to enable any of the following capabilities?
Add a Override Access Token option

Describe alternatives you've considered

use amplify override auth
and in override.ts

import {
  AmplifyAuthCognitoStackTemplate,
  AmplifyProjectInfo,
} from "@aws-amplify/cli-extensibility-helper";

export function override(
  resources: AmplifyAuthCognitoStackTemplate,
  amplifyProjectInfo: AmplifyProjectInfo
) {
  resources.userPool.userPoolAddOns = {
    AdvancedSecurityMode: "ENFORCED",
  }; // This works if I just ignore the type error
  resources.userPool.lambdaConfig = {
    preTokenGenerationConfig: {
      // ...
      // This is not currently supported
      // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-lambdaconfig.html#cfn-cognito-userpool-lambdaconfig-pretokengenerationconfig
      LambdaVersion: "V2_0",
    },
  };
}

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this feature request

Would this feature include a breaking change?

  • ⚠️ This feature might incur a breaking change
@Zhuohui-Li Zhuohui-Li added the pending-triage Issue is pending triage label Mar 31, 2024
@ykethan
Copy link
Contributor

ykethan commented Apr 2, 2024

Hey @Zhuohui-Li, thank you for filing this, marking this as feature request.

Note: tried overriding the property but was unable to modify the the property to v2

resources.userPool.addPropertyOverride("LambdaConfig", {
    ...resources.userPool.lambdaConfig,
    PreTokenGenerationConfig: {
      LambdaVersion: "V2_0",
      LambdaArn:
        "<arn>",
    },
  });

@ykethan ykethan added auth Issues tied to the auth category of the CLI feature-request Request a new feature p4 and removed pending-triage Issue is pending triage labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues tied to the auth category of the CLI feature-request Request a new feature p4
Projects
None yet
Development

No branches or pull requests

2 participants