Skip to content
This repository was archived by the owner on Aug 16, 2023. It is now read-only.

Conversation

@dkhamsing
Copy link
Contributor

Hey Caleb, here's the OneDrive provider which has OAuth through Microsoft Live with a specific scope for storage permissions http://onedrive.github.io

- isTargetRedirectURL: seems a bit fragile but it works in the example app

I left out the Podfile.lock, I'm not sure how that thing is generated 😄

@calebd
Copy link
Owner

calebd commented Mar 31, 2015

How is isTargetRedirectURL: fragile?

@calebd
Copy link
Owner

calebd commented Mar 31, 2015

Oh I see what you're saying. So the default implementation of that method does the following:

- (BOOL)isTargetRedirectURL:(NSURL *)URL {
    NSString *targetURLString = [self.options[SimpleAuthRedirectURIKey] lowercaseString];
    NSString *actualURLString = [[URL absoluteString] lowercaseString];
    return [actualURLString hasPrefix:targetURLString];
}

So it's not strictly necessary for you to do the same. If you know it will always be https://live.com or whatever, just set that as a default option on the provider and the framework will handle it for you.

@dkhamsing
Copy link
Contributor Author

On http://onedrive.github.io/auth/msa_oauth.htm if you look at Step 1. Get an authentication code / Response, the auth code is supposed to come back as

https://login.live.com/oauth20_authorize.srf?code=df6aa589-1080-b241-b410-c4dff65dbf7c

However, I have found in my testing that it came out as

http://eeb6f219-0ae3-4197-852a-2c5de29a26cd.apps.dev.live.com/?code=5c69a65a-21b3-fd1b-b721-c5de1d597be6

Maybe it is simply a matter of dev vs production app.. Would ?code= work for both?

@dkhamsing
Copy link
Contributor Author

Uh yeah I meant my implementation of - isTargetRedirectURL: 😁

@calebd
Copy link
Owner

calebd commented Mar 31, 2015

Oh that sucks. Ok, your way is fine then. One change, if you could, use the old rangeOfString method instead of containsString since that is an iOS 8 only API.

Otherwise looks good to me!

@dkhamsing
Copy link
Contributor Author

Got it

@calebd
Copy link
Owner

calebd commented Mar 31, 2015

Thanks!!

calebd added a commit that referenced this pull request Mar 31, 2015
@calebd calebd merged commit 6b46c6e into calebd:master Mar 31, 2015
@dkhamsing
Copy link
Contributor Author

😄

@dkhamsing dkhamsing deleted the onedrive branch March 31, 2015 22:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants