Google redirect to a page like http://my-website.s3-website-eu-west-1.amazonaws.com/#/callback

50 Views Asked by At

I have an angular application that I upload to AWS S3, everything works fine with the login page, but when I authenticate with Google I redirect the authentication to http://my-website.s3-website-eu-west-1.amazonaws.com/#/callback as you see I have to use /#/ other wise AWS S3 gives an error.

My challenge now is that Google doesn't accept /#/ in Authorized redirect URIs.

enter image description here

Is there any trick to solve this issue? Google confirmation or any angular configuration.


Google error

enter image description here

1

There are 1 best solutions below

0
Youcef LAIDANI On

I found a solution for my issue, all I do is configure the redirection in my S3 bucket.

Under Properties tab => Static website hosting section => choose Edit. Scroll down to the Redirection rules section and enter these rules in the text box:

[
    {
        "Condition": {
            "HttpErrorCodeReturnedEquals": "404"
        },
        "Redirect": {
            "HostName": "my-website.s3-website-eu-west-1.amazonaws.com",
            "HttpRedirectCode": "307",
            "Protocol": "http",
            "ReplaceKeyPrefixWith": "#/"
        }
    }
]