user3702357
user3702357

Reputation: 1

one drive Redirect url not allowing query string parameters

Currently, I'm trying to integrate the OneDrive SDK onto a website. However, I'm having issue with redirecting with authentication.

Normal route:

Is there a way around this?

The only thing I could figure out is using a URL that is an alias for the URL with the query params, but that just seems like a hack solution. It's hard to believe that there isn't a way for a user to redirect with query params to indicate at what stage they left off on the site.

Example of invalid redirect url as http://skydpk.com/index.php?a=ap&addon=file_sharing&page=skydrive

Any advice appreciated, Thanks, D

Upvotes: 0

Views: 1069

Answers (1)

Conrad Herrmann
Conrad Herrmann

Reputation: 271

You can pass extra parameters through the state parameter of the /authorize request. Onedrive/Skydrive will pass back the state parameter in the last redirect to you.

So if the redirect url is

http: //skydpk.com/index.php

then your first OAuth leg looks like this:

https://login.live.com/oauth20_authorize.srf?client_id=CLIENT_ID&scope=SCOPES&response_type=code&redirect_uri=http%3A%2F%2Fskydpk.com%2Findex.php&state=state=a%3Dap%26addon%3Dfile_sharing%26page%3Dskydrive

The last OAuth leg then looks like this:

http://skydpk.com/index.php?code=AUTH_CODE&state=a%3Dap%26addon%3Dfile_sharing%26page%3Dskydrive

Upvotes: 1

Related Questions