Forum

Browse topics, discover Works With Legrand community!

Token is invalid or doesn't include required scope(s)

Hello,

I  have created the application selecting all the scopes:

"01_Application"

Later I performed the operations to obtain the access_token and the refresh_token.

I can also correctly perform the flow to refresh the token.

"02_Token"

Unfortunately when I try to use the token to get chronothermostat status, I get the an error.

I have tried using both access_token and id_token.

I also tried to put and not put “Bearer” as prefix.

"03_Get"

Using the token generated by “Try it”:

"04_Get2"

 

It works:

"05_Get3"

What am I doing wrong?

Thank you

Hello Giancarlo,

It seems to work on my side. Did you linked your account in your “Thermostat” application ?

If no, click on the upper left button -> Account -> Third-party access and link your account

If you already did it, try to disconnect/reconnect the link

Please tell me if it resolved your issue

Have a good day,

Leslie – Community Manager

Thanks for the reply.

Yes, I linked my account in my “Thermostat” application already a while ago because I had integrated it with Alexa.

Last night I tried to disconnect/reconnect the link but it did not solve the problem.

I also tried to revoke authorizations to my application and redo the operations to obtain the access_token and the refresh_token.

Like a few days ago, I can also correctly perform the flow to refresh the token.

Unfortunately when I try to use the token to get chronothermostat status, I get this error:

{
“statusCode”: 401,
“message”: “Unauthorized. Supplied access token is invalid or doesn’t include required scope(s).”
}

I have tried using both access_token and id_token.

I also tried to put and not put “Bearer” as prefix using both access_token and id_token.

Using the token generated by “Try it” it works.

In order not to make unsuccessful attempts, in the “Authorization” header of the request for the status of the Thermostat, should i use access_token or id_token?

Is the “Bearer” prefix necessary?

I await your kind reply.

Thank you

Hi Giancarlo,

Here is a screenshot of a working request :

"request"

I used the access_token I generated via a POST request. You’ll need to add the “Bearer” prefix

Hoping it will resolve your issue

Have a good day,

Leslie – Community Manager

Hi, among the various combinations I had already tried what you indicated to me.
I tried again now but unfortunately it doesn’t work, the error is always the same:

{
“statusCode”: 401,
“message”: “Unauthorized. Supplied access token is invalid or doesn’t include required scope(s).”
}

I don’t know what to think because everything seems correct to me, I don’t know why it replies that are not include the required scopes. Furthermore, using the token generated by “Try it”, it works.

A few days ago I applied for a new application only with the scopes “comfort.read” and “comfort.write”, as soon as you approve it, I will test it with this other one.

An other idea :

Is the email address you use when your application ask for Accept/Deny scopes the same as your Developer’s account email/password ? (with the https://partners-login.eliotbylegrand.com/authorize procedure)

Have a good day,

Leslie – Community Manager

Hi,

Yes, I use rhe same email/password.

Now that my new application has approved I have redone everything and it works!

It was probably something related to the old application on which I had selected all the scopes.

In the new one, I only selected comfort.read and conform.write and it works.

I would like to delete the old application but I have not found a way, can you tell me how to do it?

Thank you

Hello,

Glad to hear that creating a new app resolved your issue !

But it’s not normal that it didn’t work with the former application

Could you please send me via the contact form your application’s name and ID so that our teams could investigate ? We will then manually delete your application in our backoffice

Thanks and have a good day,

Leslie – Community Manager

Hi, I have sent the information you requested.

Thank you

Hello,

Thanks, I received it 😉

I forwarded it to a developer and I keep you informed if we find an explanation

Have a good day,

Leslie – Community Manager

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.