Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnauthorizedRequest #40

Open
hswlab opened this issue Oct 5, 2023 · 8 comments
Open

UnauthorizedRequest #40

hswlab opened this issue Oct 5, 2023 · 8 comments

Comments

@hswlab
Copy link

hswlab commented Oct 5, 2023

Is someone else getting this Error?

UnauthorizedRequest

"The conversationSignature is not set and is required to ensure that you have permission to use our APIs. IsAuthenticated=False. App ID="

Edit: If I comparing the current payload on Bing, it seems that "ConversationSignature" is not send in the payload anymore and it is also missing in the new conversation response. I removed the attribute from the payload, but still get this error. So, the create call still works, only when creating the websocket connection there are problems. I can't figure out why this doesn't work with the modified payload. Is anyone here more familiar with websockets?

@hswlab
Copy link
Author

hswlab commented Oct 6, 2023

I finally figured it out. Bing no longer sends the signature in the response content, but in the response header inside X-Sydney-EncryptedConversationSignature. I now use my own solution to communicate with Bing, but the communication principle is more or less the same as with the Bing API here, with the modifications for the signature the Bing API should work again. At least I already could test it successfully in my implementation. :)

@neon-sunset
Copy link
Collaborator

@hswlab Thank you, noted this for work once I'll get to next pass of RE and fixes! (currently busy with another project)

@gunpal5
Copy link

gunpal5 commented Oct 7, 2023

@neon-sunset I just added a pull request #41

@chinazhaoht
Copy link

@hswlab I already know how to obtain a signature, but how should I use it in new communication methods?

@hswlab
Copy link
Author

hswlab commented Oct 7, 2023

@chinazhaoht For websocket request with ChatHub, this string is currently set in the URL parameter of sec_access_token.
wss://sydney.bing.com/sydney/ChatHub?sec_access_token=TheSignature

If you use the Bing API, you have to wait until the code in the API is customized. @gunpal5 seems to have already an update for this issue. :)

@chinazhaoht
Copy link

I used the signature in the X-Sydney-Encryptedconversationsignature header from the create conversation response, URL-encoded it, and passed it as the sec_access_token to the chathub interface, but the chathub still returns "unauthorized request" and "chathub not authorized".

@gunpal5
Copy link

gunpal5 commented Oct 7, 2023

@chinazhaoht save your time and use this PR: #41

@chinazhaoht
Copy link

@gunpal5 Thank you, I have already solved this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants