How we can create an internal platform for managing external clients with M2M flows in Amazon Cognito, with full example written in TypeScript and the AWS CDK.
To deploy the central auth service:
- CD into
shared-central-auth
. - Run
npm run deploy:stateful
in the terminal. - Run
npm run deploy:stateless
in the terminal. - CD into the
client
folder up one level and change the API on line 5 in the fileshared-central-auth/client/src/App.tsx
to match the deployed API in the stateless stack. - In the same client folder run
npm run start
to fire up the client app.
At this point you can use the UI to create a resource server, client and scopes.
- CD into the
resource-server-service
folder. - In the file
src/config/config.ts
add the relevant information to config. - Run
npm run deploy
in the terminal.
To deploy the client service:
- CD into the
client-service
folder. - In the
config.ts
file change the config values to match the ones created through the UI. - Run
npm run deploy
in the terminal.
Please run the relevnt npm run remove
npm scrips in the folders in the reverse order as the deploy.