Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finished pass one of OAuth Consumer Sample

  • Loading branch information...
commit 01a7839373711e34d9344140f0721f86e6ad10e8 1 parent ea12bca
Owen Evans authored
View
257 oauth-sample-consumer-cocoa/AccessTokenView.xib
@@ -37,16 +37,16 @@
</object>
<object class="NSCustomView" id="560574705">
<reference key="NSNextResponder"/>
- <int key="NSvFlags">268</int>
+ <int key="NSvFlags">12</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="994976933">
+ <object class="NSTextField" id="931292101">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{277, 434}, {251, 22}}</string>
+ <string key="NSFrame">{{163, 296}, {251, 22}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="338218003">
+ <object class="NSTextFieldCell" key="NSCell" id="551235937">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
@@ -55,7 +55,7 @@
<double key="NSSize">1.300000e+01</double>
<int key="NSfFlags">1044</int>
</object>
- <reference key="NSControlView" ref="994976933"/>
+ <reference key="NSControlView" ref="931292101"/>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSColor" key="NSBackgroundColor" id="981358812">
<int key="NSColorSpace">6</int>
@@ -77,44 +77,10 @@
</object>
</object>
</object>
- <object class="NSTextField" id="211950981">
- <reference key="NSNextResponder" ref="560574705"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{277, 402}, {251, 22}}</string>
- <reference key="NSSuperview" ref="560574705"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="484530478">
- <int key="NSCellFlags">-1804468671</int>
- <int key="NSCellFlags2">272630784</int>
- <string key="NSContents"/>
- <reference key="NSSupport" ref="312662123"/>
- <reference key="NSControlView" ref="211950981"/>
- <bool key="NSDrawsBackground">YES</bool>
- <reference key="NSBackgroundColor" ref="981358812"/>
- <reference key="NSTextColor" ref="415799492"/>
- </object>
- </object>
- <object class="NSTextField" id="931292101">
- <reference key="NSNextResponder" ref="560574705"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{277, 370}, {251, 22}}</string>
- <reference key="NSSuperview" ref="560574705"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="551235937">
- <int key="NSCellFlags">-1804468671</int>
- <int key="NSCellFlags2">272630784</int>
- <string key="NSContents"/>
- <reference key="NSSupport" ref="312662123"/>
- <reference key="NSControlView" ref="931292101"/>
- <bool key="NSDrawsBackground">YES</bool>
- <reference key="NSBackgroundColor" ref="981358812"/>
- <reference key="NSTextColor" ref="415799492"/>
- </object>
- </object>
<object class="NSTextField" id="894586955">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{277, 338}, {251, 22}}</string>
+ <string key="NSFrame">{{163, 264}, {251, 22}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="127294107">
@@ -128,18 +94,18 @@
<reference key="NSTextColor" ref="415799492"/>
</object>
</object>
- <object class="NSTextField" id="349697069">
+ <object class="NSTextField" id="197016136">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{176, 436}, {96, 17}}</string>
+ <string key="NSFrame">{{33, 298}, {125, 17}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="701661113">
+ <object class="NSTextFieldCell" key="NSCell" id="611143185">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
- <string key="NSContents">Consumer Key</string>
+ <string key="NSContents">Request Token Key</string>
<reference key="NSSupport" ref="312662123"/>
- <reference key="NSControlView" ref="349697069"/>
+ <reference key="NSControlView" ref="197016136"/>
<object class="NSColor" key="NSBackgroundColor" id="890581049">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
@@ -157,42 +123,10 @@
</object>
</object>
</object>
- <object class="NSTextField" id="917558501">
- <reference key="NSNextResponder" ref="560574705"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{161, 404}, {111, 17}}</string>
- <reference key="NSSuperview" ref="560574705"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="53595757">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">272630784</int>
- <string key="NSContents">Consumer Secret</string>
- <reference key="NSSupport" ref="312662123"/>
- <reference key="NSControlView" ref="917558501"/>
- <reference key="NSBackgroundColor" ref="890581049"/>
- <reference key="NSTextColor" ref="264198047"/>
- </object>
- </object>
- <object class="NSTextField" id="197016136">
- <reference key="NSNextResponder" ref="560574705"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{147, 372}, {125, 17}}</string>
- <reference key="NSSuperview" ref="560574705"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="611143185">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">272630784</int>
- <string key="NSContents">Request Token Key</string>
- <reference key="NSSupport" ref="312662123"/>
- <reference key="NSControlView" ref="197016136"/>
- <reference key="NSBackgroundColor" ref="890581049"/>
- <reference key="NSTextColor" ref="264198047"/>
- </object>
- </object>
<object class="NSTextField" id="339457297">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{131, 340}, {141, 17}}</string>
+ <string key="NSFrame">{{17, 266}, {141, 17}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="638447967">
@@ -208,7 +142,7 @@
<object class="NSButton" id="568522222">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{208, 138}, {152, 32}}</string>
+ <string key="NSFrame">{{139, 12}, {152, 32}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="995554620">
@@ -228,7 +162,7 @@
<object class="NSButton" id="1067460704">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{185, 170}, {199, 32}}</string>
+ <string key="NSFrame">{{116, 44}, {199, 32}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="93186111">
@@ -248,7 +182,7 @@
<object class="NSTextField" id="984870824">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{277, 306}, {251, 22}}</string>
+ <string key="NSFrame">{{163, 232}, {251, 22}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1012108457">
@@ -265,7 +199,7 @@
<object class="NSTextField" id="683902648">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{131, 308}, {141, 17}}</string>
+ <string key="NSFrame">{{41, 234}, {117, 17}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="892282731">
@@ -281,7 +215,7 @@
<object class="NSTextField" id="272804485">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{135, 280}, {133, 17}}</string>
+ <string key="NSFrame">{{25, 206}, {133, 17}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="1035468755">
@@ -297,7 +231,7 @@
<object class="NSTextField" id="829096156">
<reference key="NSNextResponder" ref="560574705"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{277, 278}, {251, 22}}</string>
+ <string key="NSFrame">{{163, 204}, {251, 22}}</string>
<reference key="NSSuperview" ref="560574705"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="309075573">
@@ -311,8 +245,28 @@
<reference key="NSTextColor" ref="415799492"/>
</object>
</object>
+ <object class="NSButton" id="670357858">
+ <reference key="NSNextResponder" ref="560574705"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{6, 12}, {96, 32}}</string>
+ <reference key="NSSuperview" ref="560574705"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="498242188">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Back</string>
+ <reference key="NSSupport" ref="312662123"/>
+ <reference key="NSControlView" ref="670357858"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
- <string key="NSFrameSize">{566, 476}</string>
+ <string key="NSFrameSize">{434, 338}</string>
<reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
@@ -322,22 +276,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">consumerKey</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="994976933"/>
- </object>
- <int key="connectionID">20</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">consumerSecret</string>
- <reference key="source" ref="1001"/>
- <reference key="destination" ref="211950981"/>
- </object>
- <int key="connectionID">21</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">requestTokenKey</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="931292101"/>
@@ -392,6 +330,14 @@
</object>
<int key="connectionID">38</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">goToRequestToken:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="670357858"/>
+ </object>
+ <int key="connectionID">41</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -427,52 +373,21 @@
<reference key="object" ref="560574705"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="994976933"/>
- <reference ref="211950981"/>
<reference ref="931292101"/>
<reference ref="894586955"/>
- <reference ref="917558501"/>
- <reference ref="349697069"/>
- <reference ref="339457297"/>
- <reference ref="197016136"/>
+ <reference ref="984870824"/>
+ <reference ref="829096156"/>
<reference ref="568522222"/>
<reference ref="1067460704"/>
- <reference ref="984870824"/>
<reference ref="683902648"/>
- <reference ref="829096156"/>
<reference ref="272804485"/>
+ <reference ref="339457297"/>
+ <reference ref="197016136"/>
+ <reference ref="670357858"/>
</object>
<reference key="parent" ref="1002"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">2</int>
- <reference key="object" ref="994976933"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="338218003"/>
- </object>
- <reference key="parent" ref="560574705"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">3</int>
- <reference key="object" ref="338218003"/>
- <reference key="parent" ref="994976933"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">4</int>
- <reference key="object" ref="211950981"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="484530478"/>
- </object>
- <reference key="parent" ref="560574705"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">5</int>
- <reference key="object" ref="484530478"/>
- <reference key="parent" ref="211950981"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="931292101"/>
<object class="NSMutableArray" key="children">
@@ -501,34 +416,6 @@
<reference key="parent" ref="894586955"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">10</int>
- <reference key="object" ref="349697069"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="701661113"/>
- </object>
- <reference key="parent" ref="560574705"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">11</int>
- <reference key="object" ref="701661113"/>
- <reference key="parent" ref="349697069"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">12</int>
- <reference key="object" ref="917558501"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="53595757"/>
- </object>
- <reference key="parent" ref="560574705"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">13</int>
- <reference key="object" ref="53595757"/>
- <reference key="parent" ref="917558501"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="197016136"/>
<object class="NSMutableArray" key="children">
@@ -640,6 +527,20 @@
<reference key="object" ref="309075573"/>
<reference key="parent" ref="829096156"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">39</int>
+ <reference key="object" ref="670357858"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="498242188"/>
+ </object>
+ <reference key="parent" ref="560574705"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">40</int>
+ <reference key="object" ref="498242188"/>
+ <reference key="parent" ref="670357858"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -651,21 +552,15 @@
<string>-3.IBPluginDependency</string>
<string>1.IBEditorWindowLastContentRect</string>
<string>1.IBPluginDependency</string>
- <string>10.IBPluginDependency</string>
- <string>11.IBPluginDependency</string>
- <string>12.IBPluginDependency</string>
- <string>13.IBPluginDependency</string>
<string>14.IBPluginDependency</string>
<string>15.IBPluginDependency</string>
<string>16.IBPluginDependency</string>
<string>17.IBPluginDependency</string>
<string>18.IBPluginDependency</string>
<string>19.IBPluginDependency</string>
- <string>2.IBPluginDependency</string>
<string>26.IBPluginDependency</string>
<string>27.IBPluginDependency</string>
<string>29.IBPluginDependency</string>
- <string>3.IBPluginDependency</string>
<string>30.IBPluginDependency</string>
<string>31.IBPluginDependency</string>
<string>32.IBPluginDependency</string>
@@ -673,8 +568,8 @@
<string>34.IBPluginDependency</string>
<string>35.IBPluginDependency</string>
<string>36.IBPluginDependency</string>
- <string>4.IBPluginDependency</string>
- <string>5.IBPluginDependency</string>
+ <string>39.IBPluginDependency</string>
+ <string>40.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
<string>8.IBPluginDependency</string>
@@ -685,13 +580,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilderKit</string>
<string>com.apple.InterfaceBuilderKit</string>
- <string>{{786, 427}, {566, 476}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{482, 565}, {434, 338}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -737,7 +626,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">38</int>
+ <int key="maxID">41</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -750,12 +639,14 @@
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>getAccessToken:</string>
+ <string>goToRequestToken:</string>
<string>validateAccessToken:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
@@ -764,8 +655,6 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>accessTokenKey</string>
<string>accessTokenSecret</string>
- <string>consumerKey</string>
- <string>consumerSecret</string>
<string>requestTokenKey</string>
<string>requestTokenSecret</string>
</object>
@@ -775,8 +664,6 @@
<string>NSTextField</string>
<string>NSTextField</string>
<string>NSTextField</string>
- <string>NSTextField</string>
- <string>NSTextField</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
View
6 oauth-sample-consumer-cocoa/AccessTokenViewController.h
@@ -14,15 +14,13 @@
@interface AccessTokenViewController : ManagingViewController {
IBOutlet NSTextField *requestTokenSecret;
IBOutlet NSTextField *requestTokenKey;
- IBOutlet NSTextField *consumerKey;
- IBOutlet NSTextField *consumerSecret;
IBOutlet NSTextField *accessTokenKey;
IBOutlet NSTextField *accessTokenSecret;
}
-(IBAction) getAccessToken:(id)sender;
-(void)accessTokenTicket:(OAServiceTicket *)ticket
didFailWithError:(NSError *) error;
-- (void)accessTokenTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data;
+-(void)accessTokenTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data;
-(IBAction) validateAccessToken:(id)sender;
-
+-(IBAction) goToRequestToken:(id)sender;
@end
View
27 oauth-sample-consumer-cocoa/AccessTokenViewController.m
@@ -7,7 +7,7 @@
//
#import "AccessTokenViewController.h"
-
+#import "ApplicationController.h"
@implementation AccessTokenViewController
-(id) init
@@ -25,14 +25,8 @@ -(void) loadView
[super loadView];
NSString *consumerKeyValue = [parent getSharedValue:OACConsumerKey];
NSLog(@"Loaded Key from store %@",consumerKeyValue);
- [consumerKey setStringValue:[parent getSharedValue:OACConsumerKey]];
- [consumerSecret setStringValue:[parent getSharedValue:OACConsumerSecret]];
[requestTokenKey setStringValue:[parent getSharedValue:OACRequestTokenKey]];
[requestTokenSecret setStringValue:[parent getSharedValue:OACRequestTokenSecret]];
- [consumerKey setEditable:FALSE];
- [consumerKey setSelectable:FALSE];
- [consumerSecret setEditable:FALSE];
- [consumerSecret setSelectable:FALSE];
[requestTokenKey setEditable:FALSE];
[requestTokenSecret setSelectable:FALSE];
[accessTokenKey setEditable:FALSE];
@@ -40,14 +34,16 @@ -(void) loadView
}
-(IBAction) getAccessToken:(id)sender
{
- NSString *consumerKeyValue = [consumerKey stringValue];
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+
+ NSString *consumerKeyValue = [defaults valueForKey:OACConsumerKey];
+ NSString *consumerSecretValue = [defaults valueForKey:OACConsumerSecret];
NSLog(@"Loaded consumer key from screen %@",consumerKeyValue);
- NSString *consumerSecretValue = [consumerSecret stringValue];
NSLog(@"Loaded consumer secret from screen %@",consumerSecretValue);
OAConsumer *consumer = [[OAConsumer alloc] initWithKey:consumerKeyValue secret:consumerSecretValue];
OAToken *requestToken = [[OAToken alloc] initWithKey:[requestTokenKey stringValue] secret:[requestTokenSecret stringValue]];
NSLog(@"created token");
- NSURL *requestUrl = [NSURL URLWithString:@"http://172.19.105.240/oauth/AccessToken"];
+ NSURL *requestUrl = [NSURL URLWithString:[defaults valueForKey:OACAccessTokenUrl]];
NSLog(@"Created URL");
OAMutableURLRequest *request = [[OAMutableURLRequest alloc]initWithURL:requestUrl
consumer:consumer
@@ -55,7 +51,7 @@ -(IBAction) getAccessToken:(id)sender
realm:nil
signatureProvider:nil];
NSLog(@"Created Mutable URL Request");
- [request setHTTPMethod:@"POST"];
+ [request setHTTPMethod:@"GET"];
NSLog(@"Created Request");
OADataFetcher *fetcher = [[OADataFetcher alloc]init];
NSLog(@"Created fetcher");
@@ -96,9 +92,16 @@ -(void) accessTokenTicket: (OAServiceTicket *) ticket
}
-(IBAction) validateAccessToken:(id)sender
{
- NSString *urlString = [NSString stringWithFormat:@"http://172.19.105.240/Account/AuthoriseRequestToken?oauth_token=%@",[requestTokenKey stringValue]];
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+
+ NSString *urlString = [NSString stringWithFormat:[defaults valueForKey: OACRequestTokenAuthUrl],[requestTokenKey stringValue]];
NSURL *url = [NSURL URLWithString:urlString];
[[NSWorkspace sharedWorkspace] openURL:url];
}
+-(IBAction) goToRequestToken:(id)sender
+{
+
+ [parent setViewName:@"GetRequestToken"];
+}
@end
View
8 oauth-sample-consumer-cocoa/ApplicationController.h
@@ -9,6 +9,14 @@
#import <Cocoa/Cocoa.h>
#import "PreferenceController.h"
+extern NSString * const OACConsumerKey;
+extern NSString * const OACConsumerSecret;
+extern NSString * const OACRequestTokenKey;
+extern NSString * const OACRequestTokenSecret;
+extern NSString * const OACRequestTokenUrl;
+extern NSString * const OACRequestTokenAuthUrl;
+extern NSString * const OACAccessTokenUrl;
+
@interface ApplicationController : NSObject {
PreferenceController *preferenceController;
View
30 oauth-sample-consumer-cocoa/ApplicationController.m
@@ -8,14 +8,42 @@
#import "ApplicationController.h"
+NSString * const OACConsumerKey = @"ConsumerKey";
+NSString * const OACConsumerSecret = @"ConsumerSecret";
+NSString * const OACRequestTokenKey = @"RequestTokenKey";
+NSString * const OACRequestTokenSecret = @"RequestTokenSecret";
+NSString * const OACRequestTokenUrl = @"RequestTokenURL";
+NSString * const OACRequestTokenAuthUrl = @"RequestTokenAuthURL";
+NSString * const OACAccessTokenUrl = @"AccessTokenURL";
@implementation ApplicationController
++(void) initialize
+{
+ NSMutableDictionary *defaultValues =[NSMutableDictionary dictionary];
+
+ NSString *requestTokenUrl = @"http://term.ie/oauth/example/request_token.php";
+ NSString *accessTokenUrl = @"http://term.ie/oauth/example/access_token.php";
+ NSString *requestTokenAuthUrl = @"http://term.ie/oauth/example";
+ NSString *consumerKey = @"key";
+ NSString *consumerSecret = @"secret";
+
+ [defaultValues setObject:requestTokenUrl forKey:OACRequestTokenUrl];
+ [defaultValues setObject:accessTokenUrl forKey:OACAccessTokenUrl];
+ [defaultValues setObject:requestTokenAuthUrl forKey:OACRequestTokenAuthUrl];
+ [defaultValues setObject:consumerKey forKey:OACConsumerKey];
+ [defaultValues setObject:consumerSecret forKey:OACConsumerSecret];
+
+ [[NSUserDefaults standardUserDefaults] registerDefaults:defaultValues];
+
+}
+
+
-(IBAction) showPreferenceController:(id)sender
{
if(!preferenceController){
preferenceController = [[PreferenceController alloc]init];
}
- [preferenceController showWindow:preferenceController];
+ [preferenceController showWindow:self];
}
@end
View
72 oauth-sample-consumer-cocoa/English.lproj/MyDocument.xib
@@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="100023"/>
+ <integer value="100026"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -46,50 +46,12 @@
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSBox" id="766977174">
+ <object class="NSCustomView" id="417140068">
<reference key="NSNextResponder" ref="568628114"/>
- <int key="NSvFlags">18</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSView" id="111986555">
- <reference key="NSNextResponder" ref="766977174"/>
- <int key="NSvFlags">256</int>
- <string key="NSFrame">{{2, 2}, {616, 605}}</string>
- <reference key="NSSuperview" ref="766977174"/>
- </object>
- </object>
- <string key="NSFrame">{{4, 5}, {620, 625}}</string>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrameSize">{630, 636}</string>
<reference key="NSSuperview" ref="568628114"/>
- <string key="NSOffsets">{0, 0}</string>
- <object class="NSTextFieldCell" key="NSTitleCell">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents"/>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">1.100000e+01</double>
- <int key="NSfFlags">3100</int>
- </object>
- <object class="NSColor" key="NSBackgroundColor">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">textBackgroundColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MQA</bytes>
- </object>
- </object>
- <object class="NSColor" key="NSTextColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
- </object>
- </object>
- <reference key="NSContentView" ref="111986555"/>
- <int key="NSBorderType">3</int>
- <int key="NSBoxType">0</int>
- <int key="NSTitlePosition">3</int>
- <bool key="NSTransparent">NO</bool>
- <real value="0.000000e+00" key="NSBorderWidth2"/>
+ <string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrameSize">{630, 636}</string>
@@ -124,11 +86,11 @@
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">box</string>
+ <string key="label">view</string>
<reference key="source" ref="512844837"/>
- <reference key="destination" ref="766977174"/>
+ <reference key="destination" ref="417140068"/>
</object>
- <int key="connectionID">100024</int>
+ <int key="connectionID">100027</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -169,7 +131,7 @@
<reference key="object" ref="568628114"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="766977174"/>
+ <reference ref="417140068"/>
</object>
<reference key="parent" ref="275939982"/>
</object>
@@ -180,8 +142,8 @@
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
- <int key="objectID">100023</int>
- <reference key="object" ref="766977174"/>
+ <int key="objectID">100026</int>
+ <reference key="object" ref="417140068"/>
<reference key="parent" ref="568628114"/>
</object>
</object>
@@ -193,7 +155,7 @@
<string>-1.IBPluginDependency</string>
<string>-2.IBPluginDependency</string>
<string>-3.IBPluginDependency</string>
- <string>100023.IBPluginDependency</string>
+ <string>100026.IBPluginDependency</string>
<string>5.IBEditorWindowLastContentRect</string>
<string>5.IBWindowTemplateEditedContentRect</string>
<string>5.ImportedFromIB2</string>
@@ -209,8 +171,8 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{243, 120}, {630, 636}}</string>
- <string>{{243, 120}, {630, 636}}</string>
+ <string>{{436, 128}, {630, 636}}</string>
+ <string>{{436, 128}, {630, 636}}</string>
<integer value="1" id="5"/>
<string>{{201, 387}, {507, 413}}</string>
<reference ref="5"/>
@@ -239,7 +201,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">100024</int>
+ <int key="maxID">100027</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -252,8 +214,8 @@
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="outlets">
- <string key="NS.key.0">box</string>
- <string key="NS.object.0">NSBox</string>
+ <string key="NS.key.0">view</string>
+ <string key="NS.object.0">NSView</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
View
5 oauth-sample-consumer-cocoa/ManagingViewController.m
@@ -7,10 +7,7 @@
//
#import "ManagingViewController.h"
-NSString * const OACConsumerKey = @"ConsumerKey";
-NSString * const OACConsumerSecret = @"ConsumerSecret";
-NSString * const OACRequestTokenKey = @"RequestTokenKey";
-NSString * const OACRequestTokenSecret = @"RequestTokenSecret";
+
@implementation ManagingViewController
@synthesize managedObjectContext;
View
2  oauth-sample-consumer-cocoa/MyDocument.h
@@ -12,7 +12,7 @@
#import "ViewParent.h"
@interface MyDocument : NSPersistentDocument<ViewParent>
{
- IBOutlet NSBox *box;
+ IBOutlet NSView *view;
NSMutableArray *viewControllers;
NSMutableDictionary *sharedValueDictionary;
}
View
11 oauth-sample-consumer-cocoa/MyDocument.m
@@ -49,7 +49,7 @@ - (NSString *)windowNibName
-(void) windowControllerDidLoadNib:(NSWindowController *)wc
{
[super windowControllerDidLoadNib:wc];
- [self setView:@"GetRequestToken"];
+ [self setViewName:@"GetRequestToken"];
}
- (void) dealloc
{
@@ -61,7 +61,7 @@ - (void) dealloc
-(void)displayViewController:(ManagingViewController *)vc
{
//try to end editing
- NSWindow *w = [box window];
+ NSWindow *w = [view window];
BOOL ended = [w makeFirstResponder:w];
if(!ended)
{
@@ -70,8 +70,9 @@ -(void)displayViewController:(ManagingViewController *)vc
}
//put the view in the box
NSView *v = [vc view];
- [box setContentView:nil];
- [box setContentView:v];
+ view = v;
+ [w setContentView:nil];
+ [w setContentView:v];
@@ -83,7 +84,7 @@ -(IBAction) changeViewController:(id)sender
[self displayViewController:vc];
}
--(void) setView:(NSString *) viewName
+-(void) setViewName:(NSString *) viewName
{
if([viewName isEqualToString: @"GetRequestToken"])
View
22 oauth-sample-consumer-cocoa/PreferenceController.m
@@ -7,7 +7,7 @@
//
#import "PreferenceController.h"
-
+#import "ApplicationController.h"
@implementation PreferenceController
@@ -20,13 +20,29 @@ -(id)init
return self;
}
+-(void) windowDidLoad
+{
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ [requestTokenUrl setStringValue:[defaults valueForKey:OACRequestTokenUrl]];
+ [requestAuthUrl setStringValue:[defaults valueForKey:OACRequestTokenAuthUrl]];
+ [accessTokenUrl setStringValue:[defaults valueForKey:OACAccessTokenUrl]];
+ [consumerKey setStringValue:[defaults valueForKey:OACConsumerKey]];
+ [consumerSecret setStringValue:[defaults valueForKey:OACConsumerSecret]];
+}
+
-(IBAction) cancel:(id)sender
{
[self close];
}
+
-(IBAction) savePreferences:(id)sender
{
-
-
+ NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
+ [defaults setObject:[requestTokenUrl stringValue] forKey:OACRequestTokenUrl];
+ [defaults setObject:[requestAuthUrl stringValue] forKey:OACRequestTokenAuthUrl];
+ [defaults setObject:[accessTokenUrl stringValue] forKey:OACAccessTokenUrl];
+ [defaults setObject:[consumerKey stringValue] forKey:OACConsumerKey];
+ [defaults setObject:[consumerSecret stringValue] forKey:OACConsumerSecret];
+ [self close];
}
@end
View
294 oauth-sample-consumer-cocoa/Preferences.xib
@@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="2"/>
+ <integer value="1"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -36,10 +36,10 @@
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="432514170">
- <int key="NSWindowStyleMask">4383</int>
+ <int key="NSWindowStyleMask">287</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 267}, {514, 243}}</string>
- <int key="NSWTFlags">-1543503872</int>
+ <int key="NSWTFlags">603979776</int>
<string key="NSWindowTitle">Preferences</string>
<string key="NSWindowClass">NSPanel</string>
<nil key="NSViewClass"/>
@@ -49,23 +49,23 @@
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="975988210">
+ <object class="NSTextField" id="464767327">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{41, 190}, {131, 17}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="577088496">
+ <object class="NSTextFieldCell" key="NSCell" id="851767615">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Request Token URL:</string>
- <object class="NSFont" key="NSSupport" id="956919101">
+ <object class="NSFont" key="NSSupport" id="387783667">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">1.300000e+01</double>
<int key="NSfFlags">1044</int>
</object>
- <reference key="NSControlView" ref="975988210"/>
- <object class="NSColor" key="NSBackgroundColor" id="442893847">
+ <reference key="NSControlView" ref="464767327"/>
+ <object class="NSColor" key="NSBackgroundColor" id="145710415">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
@@ -74,63 +74,63 @@
<bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
</object>
</object>
- <object class="NSColor" key="NSTextColor" id="153311412">
+ <object class="NSColor" key="NSTextColor" id="981999116">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
- <object class="NSColor" key="NSColor" id="840631300">
+ <object class="NSColor" key="NSColor" id="803466353">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
- <object class="NSTextField" id="38296072">
+ <object class="NSTextField" id="136815139">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{41, 165}, {221, 17}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="1059462282">
+ <object class="NSTextFieldCell" key="NSCell" id="424806786">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Request Token Authorization URL:</string>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="38296072"/>
- <reference key="NSBackgroundColor" ref="442893847"/>
- <reference key="NSTextColor" ref="153311412"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="136815139"/>
+ <reference key="NSBackgroundColor" ref="145710415"/>
+ <reference key="NSTextColor" ref="981999116"/>
</object>
</object>
- <object class="NSTextField" id="310697218">
+ <object class="NSTextField" id="1039001326">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{41, 140}, {123, 17}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="168734510">
+ <object class="NSTextFieldCell" key="NSCell" id="561031089">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Access Token URL:</string>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="310697218"/>
- <reference key="NSBackgroundColor" ref="442893847"/>
- <reference key="NSTextColor" ref="153311412"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="1039001326"/>
+ <reference key="NSBackgroundColor" ref="145710415"/>
+ <reference key="NSTextColor" ref="981999116"/>
</object>
</object>
- <object class="NSTextField" id="328842213">
+ <object class="NSTextField" id="140746060">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{267, 188}, {218, 22}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="462858988">
+ <object class="NSTextFieldCell" key="NSCell" id="163577349">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="328842213"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="140746060"/>
<bool key="NSDrawsBackground">YES</bool>
- <object class="NSColor" key="NSBackgroundColor" id="300995612">
+ <object class="NSColor" key="NSBackgroundColor" id="397738281">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
@@ -139,60 +139,60 @@
<bytes key="NSWhite">MQA</bytes>
</object>
</object>
- <object class="NSColor" key="NSTextColor" id="178284391">
+ <object class="NSColor" key="NSTextColor" id="626087376">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textColor</string>
- <reference key="NSColor" ref="840631300"/>
+ <reference key="NSColor" ref="803466353"/>
</object>
</object>
</object>
- <object class="NSTextField" id="314095554">
+ <object class="NSTextField" id="1045730078">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{267, 162}, {218, 22}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="814205515">
+ <object class="NSTextFieldCell" key="NSCell" id="804498829">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="314095554"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="1045730078"/>
<bool key="NSDrawsBackground">YES</bool>
- <reference key="NSBackgroundColor" ref="300995612"/>
- <reference key="NSTextColor" ref="178284391"/>
+ <reference key="NSBackgroundColor" ref="397738281"/>
+ <reference key="NSTextColor" ref="626087376"/>
</object>
</object>
- <object class="NSTextField" id="261959574">
+ <object class="NSTextField" id="83950718">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{267, 135}, {218, 22}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="739231687">
+ <object class="NSTextFieldCell" key="NSCell" id="702967678">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="261959574"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="83950718"/>
<bool key="NSDrawsBackground">YES</bool>
- <reference key="NSBackgroundColor" ref="300995612"/>
- <reference key="NSTextColor" ref="178284391"/>
+ <reference key="NSBackgroundColor" ref="397738281"/>
+ <reference key="NSTextColor" ref="626087376"/>
</object>
</object>
- <object class="NSButton" id="1154785">
+ <object class="NSButton" id="207990820">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{169, 12}, {96, 32}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="123052805">
+ <object class="NSButtonCell" key="NSCell" id="852402187">
<int key="NSCellFlags">-2080244224</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Save</string>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="1154785"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="207990820"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
@@ -201,18 +201,18 @@
<int key="NSPeriodicInterval">25</int>
</object>
</object>
- <object class="NSButton" id="105237708">
+ <object class="NSButton" id="654114561">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{261, 12}, {96, 32}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="917872766">
+ <object class="NSButtonCell" key="NSCell" id="30683051">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Cancel</string>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="105237708"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="654114561"/>
<int key="NSButtonFlags">-2038284033</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
@@ -221,70 +221,70 @@
<int key="NSPeriodicInterval">25</int>
</object>
</object>
- <object class="NSTextField" id="627002143">
+ <object class="NSTextField" id="374386297">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{267, 102}, {218, 22}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="303273280">
+ <object class="NSTextFieldCell" key="NSCell" id="869978459">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="627002143"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="374386297"/>
<bool key="NSDrawsBackground">YES</bool>
- <reference key="NSBackgroundColor" ref="300995612"/>
- <reference key="NSTextColor" ref="178284391"/>
+ <reference key="NSBackgroundColor" ref="397738281"/>
+ <reference key="NSTextColor" ref="626087376"/>
</object>
</object>
- <object class="NSTextField" id="205409161">
+ <object class="NSTextField" id="779618314">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{267, 77}, {218, 22}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="993978825">
+ <object class="NSTextFieldCell" key="NSCell" id="873180820">
<int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="205409161"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="779618314"/>
<bool key="NSDrawsBackground">YES</bool>
- <reference key="NSBackgroundColor" ref="300995612"/>
- <reference key="NSTextColor" ref="178284391"/>
+ <reference key="NSBackgroundColor" ref="397738281"/>
+ <reference key="NSTextColor" ref="626087376"/>
</object>
</object>
- <object class="NSTextField" id="178473115">
+ <object class="NSTextField" id="131702921">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{41, 105}, {100, 17}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="25073193">
+ <object class="NSTextFieldCell" key="NSCell" id="153091484">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Consumer Key:</string>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="178473115"/>
- <reference key="NSBackgroundColor" ref="442893847"/>
- <reference key="NSTextColor" ref="153311412"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="131702921"/>
+ <reference key="NSBackgroundColor" ref="145710415"/>
+ <reference key="NSTextColor" ref="981999116"/>
</object>
</object>
- <object class="NSTextField" id="761377952">
+ <object class="NSTextField" id="168168546">
<reference key="NSNextResponder" ref="776617155"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{41, 80}, {115, 17}}</string>
<reference key="NSSuperview" ref="776617155"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="405695620">
+ <object class="NSTextFieldCell" key="NSCell" id="945234714">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Consumer Secret:</string>
- <reference key="NSSupport" ref="956919101"/>
- <reference key="NSControlView" ref="761377952"/>
- <reference key="NSBackgroundColor" ref="442893847"/>
- <reference key="NSTextColor" ref="153311412"/>
+ <reference key="NSSupport" ref="387783667"/>
+ <reference key="NSControlView" ref="168168546"/>
+ <reference key="NSBackgroundColor" ref="145710415"/>
+ <reference key="NSTextColor" ref="981999116"/>
</object>
</object>
</object>
@@ -302,7 +302,7 @@
<object class="IBOutletConnection" key="connection">
<string key="label">requestTokenUrl</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="328842213"/>
+ <reference key="destination" ref="140746060"/>
</object>
<int key="connectionID">28</int>
</object>
@@ -310,7 +310,7 @@
<object class="IBOutletConnection" key="connection">
<string key="label">requestAuthUrl</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="314095554"/>
+ <reference key="destination" ref="1045730078"/>
</object>
<int key="connectionID">29</int>
</object>
@@ -318,7 +318,7 @@
<object class="IBOutletConnection" key="connection">
<string key="label">accessTokenUrl</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="261959574"/>
+ <reference key="destination" ref="83950718"/>
</object>
<int key="connectionID">30</int>
</object>
@@ -326,7 +326,7 @@
<object class="IBOutletConnection" key="connection">
<string key="label">consumerKey</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="627002143"/>
+ <reference key="destination" ref="374386297"/>
</object>
<int key="connectionID">31</int>
</object>
@@ -334,7 +334,7 @@
<object class="IBOutletConnection" key="connection">
<string key="label">consumerSecret</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="205409161"/>
+ <reference key="destination" ref="779618314"/>
</object>
<int key="connectionID">32</int>
</object>
@@ -342,7 +342,7 @@
<object class="IBActionConnection" key="connection">
<string key="label">cancel:</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="105237708"/>
+ <reference key="destination" ref="654114561"/>
</object>
<int key="connectionID">33</int>
</object>
@@ -350,10 +350,18 @@
<object class="IBActionConnection" key="connection">
<string key="label">savePreferences:</string>
<reference key="source" ref="1001"/>
- <reference key="destination" ref="1154785"/>
+ <reference key="destination" ref="207990820"/>
</object>
<int key="connectionID">34</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="432514170"/>
+ </object>
+ <int key="connectionID">35</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -398,188 +406,188 @@
<reference key="object" ref="776617155"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="975988210"/>
- <reference ref="38296072"/>
- <reference ref="310697218"/>
- <reference ref="328842213"/>
- <reference ref="314095554"/>
- <reference ref="261959574"/>
- <reference ref="1154785"/>
- <reference ref="105237708"/>
- <reference ref="178473115"/>
- <reference ref="761377952"/>
- <reference ref="205409161"/>
- <reference ref="627002143"/>
+ <reference ref="464767327"/>
+ <reference ref="136815139"/>
+ <reference ref="1039001326"/>
+ <reference ref="140746060"/>
+ <reference ref="1045730078"/>
+ <reference ref="83950718"/>
+ <reference ref="207990820"/>
+ <reference ref="654114561"/>
+ <reference ref="131702921"/>
+ <reference ref="168168546"/>
+ <reference ref="779618314"/>
+ <reference ref="374386297"/>
</object>
<reference key="parent" ref="432514170"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
- <reference key="object" ref="975988210"/>
+ <reference key="object" ref="464767327"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="577088496"/>
+ <reference ref="851767615"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
- <reference key="object" ref="577088496"/>
- <reference key="parent" ref="975988210"/>
+ <reference key="object" ref="851767615"/>
+ <reference key="parent" ref="464767327"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
- <reference key="object" ref="38296072"/>
+ <reference key="object" ref="136815139"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1059462282"/>
+ <reference ref="424806786"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
- <reference key="object" ref="1059462282"/>
- <reference key="parent" ref="38296072"/>
+ <reference key="object" ref="424806786"/>
+ <reference key="parent" ref="136815139"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
- <reference key="object" ref="310697218"/>
+ <reference key="object" ref="1039001326"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="168734510"/>
+ <reference ref="561031089"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
- <reference key="object" ref="168734510"/>
- <reference key="parent" ref="310697218"/>
+ <reference key="object" ref="561031089"/>
+ <reference key="parent" ref="1039001326"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
- <reference key="object" ref="328842213"/>
+ <reference key="object" ref="140746060"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="462858988"/>
+ <reference ref="163577349"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">10</int>
- <reference key="object" ref="462858988"/>
- <reference key="parent" ref="328842213"/>
+ <reference key="object" ref="163577349"/>
+ <reference key="parent" ref="140746060"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
- <reference key="object" ref="314095554"/>
+ <reference key="object" ref="1045730078"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="814205515"/>
+ <reference ref="804498829"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
- <reference key="object" ref="814205515"/>
- <reference key="parent" ref="314095554"/>
+ <reference key="object" ref="804498829"/>
+ <reference key="parent" ref="1045730078"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
- <reference key="object" ref="261959574"/>
+ <reference key="object" ref="83950718"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="739231687"/>
+ <reference ref="702967678"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
- <reference key="object" ref="739231687"/>
- <reference key="parent" ref="261959574"/>
+ <reference key="object" ref="702967678"/>
+ <reference key="parent" ref="83950718"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
- <reference key="object" ref="1154785"/>
+ <reference key="object" ref="207990820"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="123052805"/>
+ <reference ref="852402187"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
- <reference key="object" ref="123052805"/>
- <reference key="parent" ref="1154785"/>
+ <reference key="object" ref="852402187"/>
+ <reference key="parent" ref="207990820"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
- <reference key="object" ref="105237708"/>
+ <reference key="object" ref="654114561"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="917872766"/>
+ <reference ref="30683051"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
- <reference key="object" ref="917872766"/>
- <reference key="parent" ref="105237708"/>
+ <reference key="object" ref="30683051"/>
+ <reference key="parent" ref="654114561"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
- <reference key="object" ref="627002143"/>
+ <reference key="object" ref="374386297"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="303273280"/>
+ <reference ref="869978459"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
- <reference key="object" ref="303273280"/>
- <reference key="parent" ref="627002143"/>
+ <reference key="object" ref="869978459"/>
+ <reference key="parent" ref="374386297"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
- <reference key="object" ref="205409161"/>
+ <reference key="object" ref="779618314"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="993978825"/>
+ <reference ref="873180820"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
- <reference key="object" ref="993978825"/>
- <reference key="parent" ref="205409161"/>
+ <reference key="object" ref="873180820"/>
+ <reference key="parent" ref="779618314"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
- <reference key="object" ref="178473115"/>
+ <reference key="object" ref="131702921"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="25073193"/>
+ <reference ref="153091484"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">24</int>
- <reference key="object" ref="25073193"/>
- <reference key="parent" ref="178473115"/>
+ <reference key="object" ref="153091484"/>
+ <reference key="parent" ref="131702921"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">25</int>
- <reference key="object" ref="761377952"/>
+ <reference key="object" ref="168168546"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="405695620"/>
+ <reference ref="945234714"/>
</object>
<reference key="parent" ref="776617155"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
- <reference key="object" ref="405695620"/>
- <reference key="parent" ref="761377952"/>
+ <reference key="object" ref="945234714"/>
+ <reference key="parent" ref="168168546"/>
</object>
</object>
</object>
@@ -625,9 +633,9 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilderKit</string>
<string>com.apple.InterfaceBuilderKit</string>
- <string>{{237, 300}, {514, 243}}</string>
+ <string>{{521, 600}, {514, 243}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{237, 300}, {514, 243}}</string>
+ <string>{{521, 600}, {514, 243}}</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -676,7 +684,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">34</int>
+ <int key="maxID">35</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
View
481 oauth-sample-consumer-cocoa/RequestTokenView.xib
@@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="1"/>
+ <integer value="30"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -35,61 +35,40 @@
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
- <object class="NSCustomView" id="830331462">
+ <object class="NSCustomView" id="346384680">
<reference key="NSNextResponder"/>
- <int key="NSvFlags">274</int>
+ <int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSButton" id="924144958">
- <reference key="NSNextResponder" ref="830331462"/>
+ <object class="NSTextField" id="1033534694">
+ <reference key="NSNextResponder" ref="346384680"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{71, 44}, {199, 32}}</string>
- <reference key="NSSuperview" ref="830331462"/>
+ <string key="NSFrame">{{17, 154}, {129, 17}}</string>
+ <reference key="NSSuperview" ref="346384680"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="56421042">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Make Request Token Call</string>
+ <object class="NSTextFieldCell" key="NSCell" id="462486828">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">272630784</int>
+ <string key="NSContents">Request Token Key:</string>
<object class="NSFont" key="NSSupport" id="618758568">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">1.300000e+01</double>
<int key="NSfFlags">1044</int>
</object>
- <reference key="NSControlView" ref="924144958"/>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">129</int>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSTextField" id="969457480">
- <reference key="NSNextResponder" ref="830331462"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{133, 184}, {187, 22}}</string>
- <reference key="NSSuperview" ref="830331462"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="11559764">
- <int key="NSCellFlags">-1804468671</int>
- <int key="NSCellFlags2">272630784</int>
- <string key="NSContents"/>
- <reference key="NSSupport" ref="618758568"/>
- <reference key="NSControlView" ref="969457480"/>
- <bool key="NSDrawsBackground">YES</bool>
- <object class="NSColor" key="NSBackgroundColor" id="622923824">
+ <reference key="NSControlView" ref="1033534694"/>
+ <object class="NSColor" key="NSBackgroundColor" id="480472102">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
- <string key="NSColorName">textBackgroundColor</string>
+ <string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MQA</bytes>
+ <bytes key="NSWhite">MC42NjY2NjY2OQA</bytes>
</object>
</object>
- <object class="NSColor" key="NSTextColor" id="447606667">
+ <object class="NSColor" key="NSTextColor" id="268451797">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
- <string key="NSColorName">textColor</string>
+ <string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor" id="539991678">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
@@ -97,80 +76,81 @@
</object>
</object>
</object>
- <object class="NSTextField" id="410975840">
- <reference key="NSNextResponder" ref="830331462"/>
+ <object class="NSTextField" id="132591743">
+ <reference key="NSNextResponder" ref="346384680"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 189}, {111, 17}}</string>
- <reference key="NSSuperview" ref="830331462"/>
+ <string key="NSFrame">{{167, 151}, {200, 22}}</string>
+ <reference key="NSSuperview" ref="346384680"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="686398635">
- <int key="NSCellFlags">68288064</int>
+ <object class="NSTextFieldCell" key="NSCell" id="653007753">
+ <int key="NSCellFlags">-1804468671</int>
<int key="NSCellFlags2">272630784</int>
- <string key="NSContents">Consumer Secret</string>
+ <string key="NSContents"/>
<reference key="NSSupport" ref="618758568"/>
- <reference key="NSControlView" ref="410975840"/>
- <object class="NSColor" key="NSBackgroundColor" id="480472102">
+ <reference key="NSControlView" ref="132591743"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor" id="622923824">
<int key=