Ionic is a popular Javascript framework that leverages Angular and Apache Cordova to run hybrid apps on mobile devices. The app will allow users to sign-up, confirm/verify email and login to gain access to authorized AWS resources.
AWS Services used:
- Amazon Cognito User Pools
- Amazon Cognito Federated Identities
- AWS Account
- NodeJS with NPM
- Ionic CLI
- Create or Sign In to your AWS Cognito environment
- Create an AWS Cognito User Pool
- Create an AWS Federated Identity Pool
- Edit the AWS Federated Identity Pool, adding the AWS Cognito User Pool created in step 2(above).
- Add an App Client to the AWS Cognito User Pool created in step 2(above). Note: Make sure to uncheck the checkbox "Generate client secret".
- Clone this repo: 'git clone https://github.com/hardydex/ionic-cognito-app'
- Open the congito.config.ts file; Add the informaion for the following:
- region: 'your-region',
- userPoolId: 'your-region_1gfVMWz3c',
- appId: 'your-app-id',
- idpUrl: 'cognito-idp.your-region.amazonaws.com',
- identityPoolId: 'your-region:guid-of-the-identityPool'
- Open a bash shell and navigate to the project folder.
- Then run.
$ sudo npm install
Then, to run it, and run:
$ ionic cordova platform add ios
$ ionic cordova run ios
Substitute ios for android if not on a Mac. Note: you can also substitute ios for browser if you want to run the application in a browser:
$ ionic serve --browser -yourbrowserofchoice