-
Notifications
You must be signed in to change notification settings - Fork 41
OAuth Login Support #7
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
Open
pyro2927
wants to merge
27
commits into
samsymons:master
Choose a base branch
from
pyro2927:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
bc64b9c
Basic OAuth implementation down. Still need refresh tokens
pyro2927 d5b6c8b
Breaking Reddit OAuth Client out into it's own subclass
pyro2927 a7f5f85
Updating podfile so I can use my fork
pyro2927 d92c497
Refactoring
pyro2927 5f0797b
Allowing shared client to be a subclass
pyro2927 a9cffb5
Fixing slash and encoding redirect URI
pyro2927 9baf4f2
Making sure to set client ID and secret, idiot
pyro2927 054f843
Merge branch 'master' of github.com:samsymons/RedditKit
pyro2927 c320440
Finish OAuth login and account creation
pyro2927 fe1c4ad
Allowing refresh token to be used to obtain new access token
pyro2927 ec60551
Refucktoring
pyro2927 e3d7957
Fixing accessors
pyro2927 61abad2
Merge branch 'master' of github.com:samsymons/RedditKit
pyro2927 3cd36b1
Adding in automatic token refresh
pyro2927 4c5b28c
Pulling out subreddits from comment reply JSON
pyro2927 5a26e24
Updating target branch
pyro2927 07ab835
Adding in basic OAuth redirect_uri example
pyro2927 b08e957
Using correct API endpoint. Better error handling
pyro2927 0f38213
Merge pull request #1 from pyro2927/comment_subreddit
pyro2927 0629bc9
Targeting master branch
pyro2927 4b16c5c
Passing back JSON responses for submissions
pyro2927 85758cc
Using our existing refresh_token if the API doesn't send back a new one
pyro2927 60e795b
Switching to non-deprecated methods
pyro2927 ef73c8c
Merging in updates from @samsymons' master branch
pyro2927 96ee3b3
Adding README note
pyro2927 d32d0a8
Merge branch 'fix/post_response'
pyro2927 c411035
Tweaking README
pyro2927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // | ||
| // RKOAuthClient.h | ||
| // Pods | ||
| // | ||
| // Created by Joseph Pintozzi on 11/14/13. | ||
| // | ||
| // | ||
|
|
||
| #import "RKClient.h" | ||
|
|
||
| /** | ||
| The different kinds of scope the OAuth client can request | ||
| Explainations found here: http://www.reddit.com/dev/api | ||
| */ | ||
|
|
||
| static NSString * const kOAuthScopeEdit = @"edit"; | ||
| static NSString * const kOAuthScopeHistory = @"history"; | ||
| static NSString * const kOAuthScopeIdentity = @"identity"; | ||
| static NSString * const kOAuthScopeModConfig = @"modconfig"; | ||
| static NSString * const kOAuthScopeModFlair = @"modflair"; | ||
| static NSString * const kOAuthScopeModLog = @"modlog"; | ||
| static NSString * const kOAuthScopeModPosts = @"modposts"; | ||
| static NSString * const kOAuthScopeMySubreddits = @"mysubreddits"; | ||
| static NSString * const kOAuthScopePrivateMessages = @"privatemessages"; | ||
| static NSString * const kOAuthScopeRead = @"read"; | ||
| static NSString * const kOAuthScopeSave = @"save"; | ||
| static NSString * const kOAuthScopeSubmit = @"submit"; | ||
| static NSString * const kOAuthScopeSubscribe = @"subscribe"; | ||
| static NSString * const kOAuthScopeVote = @"vote"; | ||
|
|
||
| @interface RKOAuthClient : RKClient | ||
|
|
||
| /** | ||
| The current clientId and clientSecret for this app. | ||
| Only required if authenticating via OAuth | ||
| */ | ||
| @property (nonatomic, strong) NSString *clientId; | ||
| @property (nonatomic, strong) NSString *clientSecret; | ||
| @property (nonatomic, strong) NSString *accessToken; | ||
| @property (nonatomic, strong) NSString *refreshToken; | ||
|
|
||
| /** | ||
| Returns a RKClient ready for OAuth | ||
| Get a client ID and secret here: https://ssl.reddit.com/prefs/apps | ||
| */ | ||
| - (id)initWithClientId:(NSString *)clientId clientSecret:(NSString *)clientSecret; | ||
|
|
||
| /** | ||
| Signs into reddit via OAuth | ||
| */ | ||
| - (NSURL *)oauthURLWithRedirectURI:(NSString *)redirectURI state:(NSString *)state scope:(NSArray*)scope; | ||
| - (NSURLSessionDataTask *)signInWithAccessCode:(NSString *)accessCode redirectURI:(NSString *)redirectURI state:(NSString *)state completion:(RKCompletionBlock)completion; | ||
| - (NSURLSessionDataTask *)refreshAccessToken:(NSString*)refreshToken redirectURI:(NSString *)redirectURI state:(NSString *)state completion:(RKCompletionBlock)completion; | ||
|
|
||
| @end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making sure a shared client can be instantiated from a subclass.