I am currently trying to build a flutter module ekyc with jumio.
https://pub.dev/packages/jumio_mobile_sdk_flutter
I folllowed the setup steps, when I want to start the Jumio session, I got Authentication failed, with error code: C010401
Based on the jumio documentation:
C10401 Authentication failed API credentials invalid, retry impossible
flutter: Error: 'PlatformException(C010401, Authentication failed, {errorCode: C010401, errorMessage: Authentication failed}, null)'.
I dont know what is the problem, I followed the docs:
received the response with the authorization_token
curl –location ‘https://auth.emea-1.jumio.ai/oauth2/token’
-u CLIENT_ID:CLIENT_SECRET
–header ‘Accept: application/json’
–data-urlencode ‘grant_type=client_credentials’
It will be placed into the server side, but currently I just want to try out on the client. Here is the request:
final dio = Dio();
final String basicAuth = base64Encode(utf8.encode('$clientId:$clientSecret'));
try {
final response = await dio.post(
'https://auth.emea-1.jumio.ai/oauth2/token',
options: Options(
headers: {
'Authorization': 'Basic $basicAuth',
'Accept': 'application/json',
'Content-Type': 'application/x-www-form-urlencoded',
},
),
data: 'grant_type=client_credentials',
);
if (response.statusCode == 200) {
return response.data['access_token'];
}
And I passed this token with EU datacenter into Jumio.init.
(On the screenshot you can see I am on the eu site and there is the id and token with the right permissions)
Did I miss a step, I dont know why would it be unauthorized if the auth request calls with the clientId and the secret succeeds.