This should be the sender of a unique string i want to use in my second component
Cloud server : this is the oauth in app client which receives the code with state parameter and then requests for access token
Currently i am putting the unique string in the state parameter and then receiving it on the cloud server and then directly using it but if in case in the middle of oauth 2.0 sign in the state parameter changes the cloud dont really know it and simply uses it ahead which is not ideal.
Welcome back to the SmartThings Community, @Krushnali_Tiwari!
What do you mean by it changing it in the middle of OAuth sign in? I’ve seen the parameter’s value is carried through the different steps and doesn’t change, but if you have seen it changes, we can investigate further.
Or do you mean in case it changes on your side?
When code value is received application verifies that the state value returned by the authorization server matches the one it originally sent. If they do not match, it indicates a potential CSRF attack, and the authorization process should be aborted. This prevents an attacker from tricking a user into granting access to a malicious application.
This is the actual work of the state parameter. In my case the cloud platform dont really know the state value it is a unique value which is sent by the app. Which is raising some security flags.
Does the ‘unique value’ have meaning in itself? For example, is it effectlvely an identifier for your cloud server?
Do you have much flexibility at the app end? If the ‘unique value’ is meaningful it would be better if you could reversibly obfuscate it as thestatein such a way that it an invalid state could be recognised.