Brinsley
10/12/2021, 9:25 AMChad (cysense)
10/12/2021, 9:27 AMBrinsley
10/12/2021, 9:53 AMuserPool.addClient("user-pool-client", {
oAuth: {
flows: {
clientCredentials: true,
},
scopes: [OAuthScope.resourceServer(resourceServer, allScope)]
},
generateSecret: true,
});
If generateSecret
isn’t set then no secret is generated, but I can’t see a way to set it directly.
I have no clue about the client id side of things.Chad (cysense)
10/12/2021, 9:57 AMimport * as cognito from "@aws-cdk/aws-cognito";
const userPool = new cognito.UserPool(this, "UserPool", {
userPoolName: "my-user-pool",
signInAliases: { email: true, phone: true },
});
const userPoolClient = new cognito.UserPoolClient(this, "UserPoolClient", {
userPool,
oAuth: {
flows: {
clientCredentials: true,
},
scopes: [OAuthScope.resourceServer(resourceServer, allScope)]
},
generateSecret: true,
});
new Auth(this, "Auth", {
cognito: {
userPool,
userPoolClient,
},
});
Instead of the addClient
you are using above. Decoupling the two constructs (userPool and userPoolClient) might prevent the userPoolClient from being recreated everytime. Its a long shot because I don't think you can have a userPoolClient without a userPool but worth a try.Brinsley
10/12/2021, 10:10 AMBrinsley
10/12/2021, 10:38 AM