- Goto
https://developer.okta.com/signup/
- Signup and Create a developer account for creating application.
- Once you have created your account, you will be redirected to
https://your-sub-domain.okta.com/admin/getting-started
- Here click on
Customize Goals
and fill the details like role and stack of your application (For SPA select Angular, React, etc). - Then, below you will find the
Embed Auth Into Your App
option, SelectAdd Single-Page App
and after that on next page selectCreate New App
. - It will show popup window select Signon method as
OIDC - OpenID Connect
and Application type asSingle Page Application
. - On next page add application name, sign-in redirect URIs (e.g. for local environment angular http://localhost:4200/login/callback), sign-out redirect URIs (e.g. for local environment angular http://localhost:4200/login) and trusted Origins (e.g. for local environment angular http://localhost:4200)
- Create EC2 instance on AWS
- Install Docker with following steps:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
- Check if docker service is running
sudo service docker status
- Build your application's docker image and push it to docker repository by using following commands
sudo docker build -t docker-repo/image-name:tag .
sudo docker push docker-repo/image-name:tag
- Once docker is installed run following command to run angular SPA
sudo docker run -p 30000:80 -itd docker-repo/image-name:tag
- Now your application is deployed and accessible on
http://SERVER_IP:30000
- Add this
http://SERVER_IP:30000
in the trusted origins of application created in okta dashboard.
Demo URL: http://3.142.49.46:30000/