Skip to content
Wim Vandenhaute edited this page Mar 17, 2016 · 6 revisions

Sequence diagram

linkID Synchronous authentication

As you can see, there are 2 calls your backend should make to the linkID API

authStart

This call will start a new linkID authentication. The result of this call will contain the sessionId to be used for polling later on and a LinkIDQRInfo object containing the linkID QR Code. This object will also contain a qr code URL to be displayed in mobile environments so when the user taps the link with that URL, the linkID app will be opened.

authPoll

This call will poll linkID for the status of the authentication. The LinkIDAuthenticationState field will tell you where the user is in the authentication process. Once the user has completed the authentication process, the LinkIDAuthnResponse field will contain all the details about the user ( userId, attributes, ... )

Code

Below are the bare minimum calls needed to start and poll a linkID authentication session.

Java

LinkIDServiceClient linkIDServiceClient = LinkIDServiceFactory.getLinkIDService( LinkIDConfig.get() );

LinkIDAuthenticationContext context = new LinkIDAuthenticationContext.Builder( LinkIDConfig.get().name() ).build();

LinkIDAuthSession linkIDAuthSession = linkIDServiceClient.authStart( context, userAgent );

...

LinkIDAuthPollResponse pollResponse = linkIDServiceClient.authPoll( sessionId, null );

.NET

LinkIDServiceClient linkIDServiceClient = new LinkIDServiceClientImpl("service.linkid.be", username, password);

LinkIDAuthenticationContext context = new LinkIDAuthenticationContext();
context.applicationName = applicationName;

LinkIDAuthSession linkIDAuthSession = authStart(context, HttpContext.Current.Request.UserAgent);

...

LinkIDAuthPollResponse pollResponse = linkIDServiceClient.authPoll(sessionId, null);

PHP

$client = new LinkIDClient("service.linkid.be, $username, $password);

$authenticationContext = new LinkIDAuthenticationContext($applicationName);

$linkIDAuthnSession = $client->authStart($authenticationContext, null);

...

LinkIDAuthPollResponse pollResponse = $client.authPoll($sessionId, null);

LinkIDAuthenticationContext

This is the object that defines the configuration of the authentication session.

Clone this wiki locally