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

urldecode the access_token in GetORODetails call #16

Open
danielneu opened this issue Sep 30, 2015 · 2 comments
Open

urldecode the access_token in GetORODetails call #16

danielneu opened this issue Sep 30, 2015 · 2 comments

Comments

@danielneu
Copy link
Contributor

Hi Shravan,

we just encountered a situation where the API told us, that the access_token is not a valid AddressConstenToken.

The cause was that we extracted the value with $_REQUEST['access_token'] and simply passed it on to the call.
The format was ATza%7d... instead of Atza|..., so the call failed. A urldecode solved the problem.

Could you please add a check, so that the value can be passed in and the SDK takes care about the rest?

Best wishes
Daniel

@shrakuma
Copy link

hi Daniel
the code in the lines below should have worked. i URL decode the access token and encode it again as that is the required manner in which the access token has to be sent. I will also double verify and check this by sending the accesstoken both ways (Atza% & Atza |)
// To make sure double encoding doesn't occur decode first and encode again.
$accessToken = urldecode($accessToken);
$url = $this->profileEndpoint . '/auth/o2/tokeninfo?access_token=' . urlEncode($accessToken);

@danielneu
Copy link
Contributor Author

Hi Shravan,

I was just thinking if we could do something like the following inside the SDK:

if(!strpos($access_token, "|"){
$access_token = urldecode($access_token);
}
...

Or something more elaborate, but I think the idea is clear.

Best wishes
Daniel

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

No branches or pull requests

2 participants