Client authentication
Introduction
The Onegini SDK gives the end-developer the flexibility of being in control over building the requests and handling the responses. Therefore, it is your
responsibility to perform user authentication by calling OneginiClient#UserClient#authenticateClient
whenever a Resource Gateway responds with
401 unauthorized status code. Please refer to the User authentication topic guide to read more about user authentication.
Authenticate client
The DeviceClient#authenticateDevice
method performs client authentication. The SDK uses client credentials to request an access token object,
which is used to perform anonymous resource calls.
In order to call the authenticateDevice
method two arguments have to be passed:
String[] scopes
the client authentication is requested for,OneginiDeviceAuthenticationHandler
interface implementation.
Example implementation
When client authentication finishes successfully then onSuccess
method will be called. At this point, you can perform anonymous resource calls as described
in the next topic.