We have created Html custom component with JS script to retrieve all messages of a Teams chat, it is loaded in a preview screen.We managed to retrieve all messages of a given chat and show them.For logged user that participates in the chat we what to give them he option of deleting there messages.
In the script we are trying to authenticate the user with OAuth2.0 similar to how Oauth user login process action works. The only difference is that a state parameter is generated for the login URL session an is included in the URL query string , also as a parameter. We tried generating a state GUID in the same format hat the process action provides in the flow but we encountered this error:
--”The state parameter, 1dbfcd91-e154-4aaf-a71f-5b735aff11de, received from the OAuth server does not point to an existing process flow resource.”
If we omit this parameter we get this error
--”Received state, 'null', from the OAuth server but it is not in the correct format. The expected state format is a guid.”
Do you have any suggestion to how we can get access to the “state” parameter implement it in an oher way in JavaScript.