-
Notifications
You must be signed in to change notification settings - Fork 2
Authentication
As you can see, there are 2 calls your backend should make to the linkID API
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.
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, ... )
Below are the bare minimum calls needed to start and poll a linkID authentication session.
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 );
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);
$client = new LinkIDClient("service.linkid.be, $username, $password);
$authenticationContext = new LinkIDAuthenticationContext($applicationName);
$linkIDAuthnSession = $client->authStart($authenticationContext, null);
...
LinkIDAuthPollResponse pollResponse = $client.authPoll($sessionId, null);
This is the object that defines the configuration of the authentication session.