I am using AWS Cognito Hosted UI URL to login to my angular application. I am able to login successfully and receiving access token as well. I am able to redirect to localhost home page when I run my application locally.
The above URL works fine and after logging in, it redirects to http://localhost:4200/admin/home
I am facing problem when I am changing the localhost to DNS. I have angular app which is hosted on S3 as static website. I am using Route 53 -> CloudFront -> S3 to access my angular application.
I am trying to redirect it to https://mydomain/admin/home
But I am getting follwing error.
I have tried different solution but it is not working.
S3 bucket policy :
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::<bucketname>/*"
}
]
}
My S3 has public access.
I have tried entering the indext.html in Default root object of cloud front. (https://serverfault.com/questions/581268/amazon-cloudfront-with-s3-access-denied)
But I am unable to figure out how to redirect to home page using domain name instead of local host.