This repository contains the open source Java SDK that allows you to access the Ukey1 API from your Java app.
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.
- User clicks to "sign-in" button
- you may use our unified sign-in button
- SDK sends a connection request to our API and gets a unique Gateway URL
- User is redirected to Ukey1 Gateway
- User signs in using their favourite solution and authorizes your app
- User is redirected back to predefined URL
- SDK checks the result and gets a unique access token
- That's it - user is authenticated (your app can make API calls to get user's data)
You can also download our API specification in the following formats:
- RAML 1.0 specification (learn more about RAML)
- Swagger 2.0 specification (learn more about Swagger or open the specification in editor)
First, you need your app credentials (App ID
and Secret Key
).
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>
First, you need to make a request to our endpoint /auth/connect
to get Gateway URL. Then redirect user to that URL.
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.
This code is released under the MIT license. Please see LICENSE file for details.
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!
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].