API to Bitbucket with OAUTH

Hi,friends! Can i use API Bitbucket with OAUTH?
Thank you :slight_smile:

Welcome to the Atlassian developer community @AntiSoundWorld.

Yes, you can use the Bitbucket Cloud REST API with OAuth 2.0.


Thank you!
I am trying “Request authorization from the end user by sending their browser”.
my code is:
document.location.href = ‘https://bitbucket.org/site/oauth2/authorize?client_id=secret&response_type=code’;

But browser console tell me “Refused to display in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’.”

how i can fix that?


It is our interpretation of the OAuth 2.0 spec that authorization code flow is not designed in such a way that it can run securely in an iframe. Can you let the flow work with simple browser redirection? Or can you explain more about why you need the authorization flow to work inside an iframe?

1 Like

My forge app(CustomUI) collect information of user from API Jira and Bitbucket.

Jira using module requestJira( ) with OAUTH.
I want to using request to Bitbucket like Jira with oauth.))

@AntiSoundWorld, Bitbucket isn’t supported in Forge now. Working around that limitation now would only result in an insecure app, which is all the more dangerous with user information.

I understand! Thank you very much)