'Token: Plus operator removed from access token
I have created a URL with Access Token. When I open the URL, the + operator get removed with whitespace from the token at backend end-points. Can someone help me to know why this happening? Below is my URL with the token.
api/meeting?token=wf+hbRFOp/fI5jSsZ0KT9K7lkvZSJLUHyc8yy6TI9HE2HdEx0WXAqWxEUjQL/6vX
At controller level, token is recieved as wf hbRFOp/fI5jSsZ0KT9K7lkvZSJLUHyc8yy6TI9HE2HdEx0WXAqWxEUjQL/6vX.
Solution 1:[1]
When I open the URL, the + operator get removed with white-space from the token at backend end-points.
Yes, that's because in URLs, + is the used to represent a space. I suspect your token is actually a base64-encoded value - you should use a URL-safe base64 decodabet instead of just putting the regular base64 value directly into the query. If you must use the regular base64 one, you need to escape the + character as %2B. I'd suggest using HttpUtility.UrlEncode to do that.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jon Skeet |
