forked from calebd/SimpleAuth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleAuthFeedlyWebLoginViewController.m
More file actions
35 lines (27 loc) · 1.18 KB
/
SimpleAuthFeedlyWebLoginViewController.m
File metadata and controls
35 lines (27 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// SimpleAuthFeedlyWebLoginViewController.m
// SimpleAuth
//
// Created by Luís Portela Afonso on 26/02/14.
// Copyright (c) 2014 Byliner, Inc. All rights reserved.
//
#import "SimpleAuthFeedlyWebLoginViewController.h"
@implementation SimpleAuthFeedlyWebLoginViewController
- (id)initWithOptions:(NSDictionary *)options requestToken:(NSDictionary *)requestToken {
if ((self = [super initWithOptions:options requestToken:requestToken])) {
self.title = @"Feedly";
}
return self;
}
- (NSURLRequest *)initialRequest {
NSDictionary *parameters = @{
@"response_type" : @"code",
@"client_id" : self.options[@"client_id"],
@"redirect_uri" : self.options[@"redirect_uri"],
@"scope" : (self.options[@"scope"] != nil ? self.options[@"code"] : @"https://cloud.feedly.com/subscriptions"),
@"state" : (self.options[@"state"] != nil ? self.options[@"state"] : @"state.passed.in")
};
NSString *URLString = [NSString stringWithFormat:@"http://feedly.com/v3/auth/auth?%@", [CMDQueryStringSerialization queryStringWithDictionary:parameters]];
return [NSURLRequest requestWithURL:[NSURL URLWithString:URLString]];
}
@end