Cannot use websockets with Oauth2 token

I used the Authorize button on the API testing interface to get a private token/key. It works fine using the REST API.

However it does not work with websockets. I tried both endpoints ws and wss. I can use the demo key and all works but not the private key.

Should this work or is there another way to get a private key?

Hi @tom2460, welcome to the forums! The last time I asked about Oauth2 access on the websocket, WF staff replied ton say that it had not been implemented yet: Oauth2 Access Token.

It has been a long time since I posted that, so perhaps @dsj you can comment on whether things have changed?

1 Like

Thanks peter.

I was able to find the key in the web app js and got things going, However, it’d be nice to have a better way to get the key.

1 Like

Good catch! You’re the first person I know of to try and use the swagger-generated access token with the web socket endpoint. The only reason it doesn’t work is that we didn’t turn it on - but there’s no reason not to turn it on so we’ve just done that now. Try again with the token you generated (or generate another). You can also continue to use the dev key found in the docs.

Definitely not ideal - the web app API key is subject to change and/or being white-listed by referring domain (currently we’re only monitoring it, but not yet restricting it).

It actually has been implemented on the back-end, but we still don’t have the client tools live. We’re making steady progress with the “updated developer tools” promised so long ago, but we’re not quite there yet thanks to other priorities that keep getting in the way. We have a goal of launching those before we start shipping Tempest. And I know what you’re thinking… “a goal without a plan is just a wish!” Fortunately, we do have a plan as well!

5 Likes

I tried again with the token from the Authorize button and it still does not work for websockets. It continues to work for REST API.

Oops. We flipped the wrong switch (there’s a different swagger app that’s not public). Try again now!

It is still not working.
Tom

Can you try again when you get a chance.

1 Like

Its working now! I am using the token obtained with the Oauth2 Authorize button for websockets.
Thanks for you help!

3 Likes

Actually, I was thinking “If a BLE client initiates a connection and nobody hears it, does it mean that we’re still getting six more weeks of winter???” :joy:

6 Likes