Hello,
I have the following scenario, I have two registered application in EDP API for production and QA environment. In sepparetly way when the proccess in production is active we do not have any problem with the login and refresh token, but when we active the QA environment proccess with the other app key the login is ok but in both environment at the moment that we want to refresh the token with the following headers
params.add(new BasicNameValuePair("client_id", 'myid'));
params.add(new BasicNameValuePair("username", 'myusername'));
params.add(new BasicNameValuePair("grant_type", "refresh_token"));
params.add(new BasicNameValuePair("refresh_token", refreshToken));
I got
Login Rejected. Authentication token not provided.After that error, we try again refresh the token, after five attempts the login is called again without refresh the token to get a new one.
This is the complete code for authentication
params.add(new BasicNameValuePair("client_id", Singleton.getInstance().getRdpApplicationId()));
params.add(new BasicNameValuePair("username", Singleton.getInstance().getRDPUser()));
//login for first time
if(refreshToken == null) {
params.add(new BasicNameValuePair("password", Singleton.getInstance().getRDPPassword()));
params.add(new BasicNameValuePair("grant_type", "password"));
params.add(new BasicNameValuePair("takeExclusiveSignOnControl", "true"));
}else {
// refresh token every 5 minutes
params.add(new BasicNameValuePair("grant_type", "refresh_token"));
params.add(new BasicNameValuePair("refresh_token", refreshToken));
}
httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8"));
Im wondering if something is missing or the header takeExclusiveSignOnControl work like only mantain one login no matter what app key I use affecting the other login in a different environment. Or what is the correct way to handle this authentication flow with two environment at the same time.
**The processes run in separate environments
Thanks