Skip to content

Latest commit

 

History

History
86 lines (57 loc) · 3.44 KB

README.md

File metadata and controls

86 lines (57 loc) · 3.44 KB

Ukey1 SDK for Java

This repository contains the open source Java SDK that allows you to access the Ukey1 API from your Java app.

IMPORTANT NOTICE: This SDK is currently in development stage.

About Ukey1

Ukey1 is an aggregator of your user's social identities. Ukey1 is also a OAuth 2.0 provider but what is more important, it connects all major identity providers (like Google or Facebook) into one sophisticated solution. Read more.

Ukey1 flow for this Java SDK

  1. User clicks to "sign-in" button
  1. SDK sends a connection request to our API and gets a unique Gateway URL
  2. User is redirected to Ukey1 Gateway
  3. User signs in using their favourite solution and authorizes your app
  4. User is redirected back to predefined URL
  5. SDK checks the result and gets a unique access token
  6. That's it - user is authenticated (your app can make API calls to get user's data)

API specification

You can also download our API specification in the following formats:

Requirements

Installation

Usage

First, you need your app credentials (App ID and Secret Key).

Sign-in / sign-up / log-in - all buttons in one

Your app may look like this:

<html>
  <head>
    <!-- ... -->
    <link rel="stylesheet" type="text/css" href="https://gitcdn.xyz/repo/asaritech/ukey1-signin-button/master/css/ukey1-button.min.css" media="screen">
  </head>
  <body>
    <!-- ... -->
    <a href="/login" class="ukey1-button">Sign in via Ukey1</a>
    <!-- ... -->
  </body>
</html>

Connection request

First, you need to make a request to our endpoint /auth/connect to get Gateway URL. Then redirect user to that URL.

Requests for access token and user details

Once the user authorizes your app, Ukey1 redirects the user back to your app to the URL you specified earlier. The same is done if user cancels the request.

URL will look like this: http://example.org/login.php?action=check&user=XXX&_ukey1[request_id]={REQUEST_ID}&_ukey1[connect_id]={CONNECT_ID}&_ukey1[result]={RESULT}&_ukey1[signature]={SIGNATURE}#fragment where REQUEST_ID is previously used $requestId, CONNECT_ID is previously used $connectId, RESULT may be authorized, canceled or expired and SIGNATURE is a security signature.

Example

License

This code is released under the MIT license. Please see LICENSE file for details.

Contributing

If you want to become a contributor of this Java SDK, please first contact us (see our email below). If you would like to work on another SDK (in your favorite language), we will glad to know about you too!

Contact

Reporting of any issues are appreciated. If you want to contribute or you have a critical security issue, please write us directly to [email protected].