TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | May 2017 |
Maintained by Trong Dinh.
It's a library on iOS which is suitable for OAuth2. It supports authorization all websites which are using OAuth2 such as: smarthings, uber, fitbit, delivery, etc...
https://github.com/lukeredpath/LROAuth2Client: I was developing based on this library. Basically, it covers > 80% the works. Please share and thanks him about this.
https://github.com/nicklockwood/Base64: it's base64 library I'm using for this library.
UI:
Authorization:
More things:
To run the example project, clone the repo, and run pod install
from the Example directory first.
Declare OAuthRequestController:
NSMutableDictionary *dictService = [NSMutableDictionary dictionary];
[dictService setObject:@"https://www.fitbit.com/oauth2/authorize" forKey:kOAuth_AuthorizeURL];
[dictService setObject:@"https://api.fitbit.com/oauth2/token" forKey:kOAuth_TokenURL];
[dictService setObject:@"YOUR CLIENT ID" forKey:kOAuth_ClientId];
[dictService setObject:@"YOUR SECRET KEY" forKey:kOAuth_Secret];
[dictService setObject:@"YOUR CALLBACK URL" forKey:kOAuth_Callback];
[dictService setObject:@"activity heartrate location nutrition profile settings sleep social weight" forKey:kOAuth_Scope];
OAuthRequestController *oauthController = [[OAuthRequestController alloc] initWithDict:dictService];
oauthController.view.frame = self.view.frame;
oauthController.delegate = self;
[self presentViewController:oauthController animated:YES completion:^{
}];
- (void)didAuthorized:(NSDictionary *)dictResponse {
NSLog(@"%@", dictResponse);
}
OAuth2 is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "OAuth2"
Trong Dinh, [email protected]
OAuth2 is available under the MIT license. See the LICENSE file for more info.