Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS amplify redirect issue with apple-app-site #1983

Closed
4 tasks done
josea2pp opened this issue Jun 21, 2021 · 12 comments
Closed
4 tasks done

AWS amplify redirect issue with apple-app-site #1983

josea2pp opened this issue Jun 21, 2021 · 12 comments
Labels
archived This issue has been locked.

Comments

@josea2pp
Copy link

josea2pp commented Jun 21, 2021

Before opening, please confirm:

App Id

No response

Region

us-east-1

Amplify Console feature

No response

Describe the bug

I'm using aws amplify to host my front end but im getting a issue putting the universal link for ios, i put the apple-app-site-association in my root folder and create a rule in redirect part to point to that file but without extension it just get 404 but if i put and ext .json it works, the problem is that apple required that the file does't have extensions.

this is muy current config and my file is located in /root/apple-app-site-association
{
"source": "/apple-app-site-association",
"target": "/apple-app-site-association",
"status": "200",
"condition": null
}
]

Expected behavior

That aws allow me put files without extension

Reproduction steps

upload a file without extension
redirect with a rule to that file
see if it work

Build Settings

No response

Additional information

No response

@github-actions
Copy link

Hi 👋, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

@victorccccc
Copy link
Contributor

Hi, Can you add this custom rule:

[
    {
        "source": "/.well-known/apple-app-site-association",
        "target": "/apple-app-site-association",
        "status": "200",
        "condition": null
    }
]

@josea2pp
Copy link
Author

Victor, thanks for the reply,

But in that case do i have to create a sub directory on mi root? like root/.well-known/apple-app.site-association?

@victorccccc
Copy link
Contributor

Victor, thanks for the reply,

But in that case do i have to create a sub directory on mi root? like root/.well-known/apple-app.site-association?

No, you can keep apple-app-site-association in root folder.

@josea2pp
Copy link
Author

not, it seems that doesn't work it bring me the 404

these are my rules

[
{
"source": "/.well-known/apple-app-site-association",
"target": "/apple-app-site-association",
"status": "200",
"condition": null
},
{
"source": "/<*>",
"target": "/index.html",
"status": "404-200",
"condition": null
},
{
"source": "</^[^.]+$|\.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>",
"target": "/index.html",
"status": "200",
"condition": null
}
]

@victorccccc
Copy link
Contributor

victorccccc commented Jun 22, 2021

not, it seems that doesn't work it bring me the 404

these are my rules

[
{
"source": "/.well-known/apple-app-site-association",
"target": "/apple-app-site-association",
"status": "200",
"condition": null
},
{
"source": "/<*>",
"target": "/index.html",
"status": "404-200",
"condition": null
},
{
"source": "</^[^.]+$|.(?!(css|gif|ico|jpg|js|png|txt|svg|woff|ttf|map|json)$)([^.]+$)/>",
"target": "/index.html",
"status": "200",
"condition": null
}
]

Sorry for the confusion, is the root folder a folder in your Repo?
Could you put apple-app-site-association in root of your repo as target is /apple-app-site-association ?

Ref: #1209

@r0nanoc
Copy link

r0nanoc commented Jun 22, 2021

Hi,
I have tried this approach but get error. My rule is configured similar to previous comment...
[
{
"source": "/.well-known/apple-app-site-association",
"target": "/apple-app-site-association",
"status": "200",
"condition": null
}
]

However when I go to 'Add a new domain' on stripe settings --> payment methods, I get error:

We were unable to verify that you control the domain my-domain.com. When we tried to request https://my-domain.com/.well-known/apple-developer-merchantid-domain-association, it redirected to /.well-known/apple-developer-merchantid-domain-association/. The verification file must be served as a 200 at https://my-domain.com/.well-known/apple-developer-merchantid-domain-association to register my-domain.com. Did you mean to register /.well-known/apple-developer-merchantid-domain-association/?

If I access directly in browser, it gives 403 error:

AccessDenied
Access Denied
0DF9RH2HHD0FADRN
WgIpBLcTGkEZiKh+1/hjkgidisajeLJvn97Wfnm1YIJG+RCFxtDY=

Appreciate any help here.

@jameyel
Copy link

jameyel commented Jul 1, 2021

@r0nanoc getting the same error. hoping someone can help with this.

@tamagokun
Copy link

Solution is that the file itself NEEDS a file extension, and the redirect does not:

[
    {
        "source": "/.well-known/apple-app-site-association",
        "target": "/.well-known/apple-app-site-association.json",
        "status": "200",
        "condition": null
    }
]

Then amplify will be able to find it correctly.

@chris
Copy link

chris commented Jul 30, 2021

Note, @tamagokun 's answer worked for me, but just an FYI that if I put this URL in my browser, it results in the typical Amplify/CloudFront AccessDenied XML error. But, if I curl the URL, it delivers me the file just fine.

@calavera
Copy link
Contributor

calavera commented Mar 9, 2022

Thanks for providing the solution to this issue @tamagokun ! I'm going to close this issue, and I will open a new one in the docs repository so we can add this to our docs.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the archived This issue has been locked. label Oct 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked.
Projects
None yet
Development

No branches or pull requests

7 participants