We may use cookies to improve our service.
Understand Learn more

Direct login

The best choice is to integrate Ukey1 as the only authentication solution. With Ukey1 you don't need care about passwords, login and registration forms, data validation nor email verification. Ukey1 makes your life easier.

You can use our predefined buttons but it's only an option, of course. You can use you own buttons that fits to your design.

Our button with your custom text

Browse the source code


Parallel login

If you already have any login option on your website, you may want to preserve it and add Ukey1 as a second option.

In that case we recommend to use our grouped button with social media icons:

Sign in with your favourite method

Browse the source code


Complete authentication in 2 easy steps

Redirect user to Ukey1

$app = new App();
$app->appId(APP_ID)->secretKey(SECRET_KEY);
$_SESSION["requestId"] = RandomString::generate(16); // or your own ID

$connectModule = new Connect($app);
$connectModule->setRequestId($_SESSION["requestId"])
    ->setReturnUrl("http://example.org/login.php?any=parameter&you=want#fragment")
    ->setScope(["email", "image"]);
$connectModule->execute();
$_SESSION["connectId"] = $connectModule->getId();

$connectModule->redirect();

Browse our open source SDKs

Retrieve user's data

$app = new App();
$app->appId(APP_ID)->secretKey(SECRET_KEY);

$tokenModule = new AccessToken($app);
$tokenModule->setRequestId($_SESSION["requestId"])->setConnectId($_SESSION["connectId"]);
$check = $tokenModule->execute();

if ($check) {
    $_SESSION["accessToken"] = $tokenModule->getAccessToken();

    $userModule = new User($app);
    $userModule->setAccessToken($_SESSION["accessToken"]);
    $userModule->execute();
    $user = $userModule->getUser();

    if ($user->check()) {
        $userId = $user->id();
        $fullname = $user->fullname();
        $language = $user->language();
        $country = $user->country();
        $email = $user->email();
        $imageSrc = $user->thumbnailUrl();
    }
}