I need a library based on php(preferably) like loginWithBitbucket.php so that, I send authorization request to it and it will authorize the bitbucket user by opening new tab and asking for user login credentials and do the authorization and then return the response data i.e. JSON data as the response of the ajax request.
Oauth.io is one such library. Its very easy to use.