Get started
Accounts
Apps
Users
Relationships
Dialogs (Messages)
Tracks (MuseBase)
Photos
Posts
Comments
Safety
Other
Yurba CDN (cdn.yurba.one)
For Desktop Developers
To be able to login through Yurba, we support something like a simplified version of OAuth 2.0.
First, if you want to work with OAuth 2.0 you should create a new application in Yurba settings. You will receive your public key and private key, and you should also specify the Redirect URL before this. Next, add a link/button to your website that will lead to:
https://yurba.one/login/?publicKey={publicKey}&redirectUrl={redirectUrl}
Now, when following this link, a user of your site will be taken to our login page. If the user is authorized, we will ask for their permission to share some personal information with your app. It is important to understand that this is only some information. It does not include passwords, IP addresses, etc. The user can revoke the token at any time in the For developers tab.
Next, when the user grants you access, they will be redirected to your redirect URL, along with the user token for the app (not the global user token) in the query string. Now let's see how you can use this token using an example PHP script for a redirect url.
// https://segment.yurba.one/login/?success=1&token=a.q5JWmogRbHjl7TDOtyOcs4oeL4TBDNnu
if(!empty($_GET['success']) && $_GET['success'] == 1 && !empty($_GET['token'])){
$secretKey = 'secret_key';
$url = "https://api.yurba.one/apps/user/".$_GET['token'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Secret-Key: '.$secretKey
]);
$output = curl_exec($ch);
curl_close($ch);
$data = json_decode($output, true); // ShortUserModel
if($data['ID']){
// authorize your user
}
}