1. Go to this page and download the library: Download own3d/id library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
own3d / id example snippets
use SocialiteProviders\Manager\SocialiteWasCalled;
use Own3d\Id\Socialite\Own3dIdExtendSocialite;
/**
* The event handler mappings for the application.
*
* @var array
*/
protected $listen = [
SocialiteWasCalled::class => [
// add your listeners (aka providers) here
Own3dIdExtendSocialite::class,
],
];
use Own3d\Id\Facades\Own3dId;
Own3dId::withClientId('abc123')->withToken('abcdef123456')->getAuthedUser();
public function retrievingToken(string $grantType, array $attributes)
public function getAuthedUser()
public function setAuthedUserEmailAddress(string $email)
public function getUserById(string $id)
public function getUsersByEmail(string $email)
public function getUserConnections(array $parameters = [])
public function getUserConnectionByPlatformId(string $platform, string $id)
public function sendEvent(string $type, array $data, string $version)
Route::get('/user', function () {
//
})->middleware('auth:api');
Route::get('/test', function () {
// Access token has both "user:read" and "connections" scopes...
})->middleware(['auth:api', 'user:read,connections']);
Route::get('/test', function () {
// Access token has either "user:read" or "connections" scope...
})->middleware(['auth:api', 'scope:user:read,connections'])
use Illuminate\Http\Request;
Route::get('/orders', function (Request $request) {
if ($request->user()->tokenCan('user:read')) {
//
}
});
use Own3d\Id\Http\Middleware\CheckClientCredentials;
protected $routeMiddleware = [
'client' => CheckClientCredentials::class,
];
Route::get('/test', function (Request $request) {
...
})->middleware('client');
Route::get('/test', function (Request $request) {
...
})->middleware('client:user:read,your-scope');
use Illuminate\Http\Request;
use Own3d\Id\Auth\Own3dSsoUserProvider;
use Own3d\Id\Own3dId;
public function boot()
{
...
Own3dIdGuard::register();
Own3dSsoUserProvider::register();
}