Ask our Experts
Didn't find what you are looking for? Ask our experts!
Launch of Consumer/Home Owner registration process! We are pleased to announce the commencement of the Consumer/Home Owner Registration Process on Community. Consumers/Home Owners may now proceed to register by clicking on Login/Register. The process is straightforward and designed to be completed in just a few steps.
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Search in
Link copied. Please paste this link to share this article on your social media post.
Hi,
Our software is trying to obtain a token but it is always failing. See the code below.
public static int ObtainBearerToken (out BearerToken bearerToken)
{
bearerToken = null;
_bearerToken = null;
try
{
// Obtain Token
Uri uri = new Uri(Settings.m_strURL);
_log.InfoFormat("ObtainBearerToken uri = '{0}', user = '{1}', pass = '{2}'", uri.ToString(), Settings.m_strUser, "*******" /*Settings.m_strPassword */);
bearerToken = BearerToken.ObtainToken(uri, Settings.m_strUser, Settings.m_strPassword, "GetToken");
_bearerToken = bearerToken;
if (bearerToken == null)
{
_log.ErrorFormat("ObtainBearerToken fail, token is empty or null");
return -1;
}
_log.InfoFormat("ObtainBearerToken pass, token = '{0}'", bearerToken.ToString());
return 0;
}
catch (Exception ex)
{
_log.ErrorFormat("ObtainBearerToken, Exception, msg = '{0}'", ex.Message);
return -1;
}
}
The username and password seems to be Okay. This is the error that the customer is getting.
"[CM] ERROR SEEwsRestApi - ObtainBearerToken fail, token is empty or null"
Any idea what may cause this error and what should we check?
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
If there are no errors thrown please set debug level to debug and enable rest serve logging. Also make sure that the base address is used, and not the swagger URL.
BR
Armend
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.