Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Invalid redirect_uri when doing OAuth2 with Bitbucket Data Center for incoming external app

pscheit May 30, 2024

Hi, I am working on a bitbucket server/data center incoming application link.

I am developing locally so I have bitbucket server running in docker via http  behind a caddy proxy, that terminates ssl
I have a PHP application where I want to do OAuth requests with.  Pretty sure that the code is okay, because we have this running in production without issues.

When I hit the bitbucket oAuth2 authorize endpoint - I get a consent response of 412 code and the message -

"HTTP Status 412 – Precondition Failed Invalid 'redirect_uri' URL parameter provided"
image.png

I am using the bitbucket.properties to allow local development:

atlassian.oauth2.provider.skip.base.url.https.requirement=true
atlassian.oauth2.provider.skip.redirect.url.https.requirement=true

as per https://confluence.atlassian.com/bitbucketserver0720/oauth-2-0-provider-system-properties-1116282016.html

I am sure they are active and used, because otherwise I cannot add the redirect url into the application link.

I am 100% certain that the redirect_uri matches the one I have configured in the application link. I am redirected from the authorization page to the consent page (invalid redirect uri would be detected before?) I do not have any special chars in my URL. Url encoding / with or without %2f doesnt help.

We have two different redirect uris that were separated by , in the application link, but even if I reduce this to one redirect url, it doesnt help.

I wonder if there are more checks to the redirect_uri that are failing: Is it doing http requests to verify? 
I enabled debug logs and didnt find something suspicious there, I just see the request in the access log and the 412 responses.

Bitbucket data center version is 8.19.3 8019003

1 answer

1 accepted

0 votes
Answer accepted
Apoorva
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 10, 2024

Hello @pscheit

Hope you're doing good.

The issue you've reported is being tracked in this bug ticket: OAUTH20-2488, which is currently open and being worked on by our developers.

As per one of the comments on the ticket, this will be resolved in Bitbucket Data Center versions 8.9.15 and 8.19.4. Both are scheduled to be released between the 1st and 2nd Tuesday of June 2024. It will also be resolved in Bitbucket 9.0.0.

Hope this helps!

 

Regards,
Apoorva

pscheit June 12, 2024

Thanks for that info!

It's really odd that I didnt find this issue via search on jira.
My apologies

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.19.3
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events