Application Link fails with No application link found with the id
Establishing an Application link from another Atlassian application to Bitbucket Server will succeed. However upon checking its integration, the application link will fail. The Application link method is using OAuth, and it will fail with the following error message.
From Bitbucket Server:
The request token you are trying to authorize is not valid. Please try another token. (Close this dialog, then go back to the site requesting access and tell it to try again.)
Authentication failed! No application link found with the id "c074c52d-5bed-389b-8b79-86b3ef4ef802"
With OAuth authentication, the server needs acknowledgement from the other application. In order to get approved, the application will be redirected to the other application. For example from JIRA to Bitbucket Server and vice versa. After approval it should get redirected to the default application. Check on the browser URL, if it didn't get redirected back to default application, it means you encountered this issue.
This issue is caused by rewrite rule in proxy settings. The URL can't be redirected back, due to the rule is not letting the application to do so.
Bypassing the rewrite rule in your proxy settings or http server should solve this issue.
If you are using IIS, please do not use "reverse rewrite host in response headers" configuration.