Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
- unpin OBPKit version
- prefer currentSession over default server info
- comments
  • Loading branch information
t0rst committed Jun 12, 2017
1 parent ca26a4a commit 7c1ca1c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "OpenBankProject/OBPKit-iOSX" "1.1.2"
github "kishikawakatsumi/UICKeyChainStore" "v2.1.1"
github "nst/STHTTPRequest" "1.1.3"
github "t0rst/OAuthCore" "0.0.2"
github "nst/STHTTPRequest" "1.1.1"
github "kishikawakatsumi/UICKeyChainStore" "v2.1.0"
github "OpenBankProject/OBPKit-iOSX" "1.0.0"
24 changes: 13 additions & 11 deletions HelloOBP-iOS/Main/DefaultServerDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@

#if 1

#define OAUTH_AUTHENTICATE_URL @"https://apisandbox.openbankproject.com/"
#define OAUTH_BASE_URL @"https://apisandbox.openbankproject.com/obp/v1.2/"
#define OAUTH_CONSUMER_KEY @"tzecy5lgatsbrvbt2ttfrxlelertfxywt3whes4q"
#define OAUTH_CONSUMER_SECRET_KEY @"eusfvy3oizylx11dr420nhxluv1rdan5qjjkgmkh"
#define OAUTH_AUTHENTICATE_URL @"https://apisandbox.openbankproject.com"
#define OAUTH_BASE_URL @"https://apisandbox.openbankproject.com/obp/v2.0.0/"
#define OAUTH_CONSUMER_KEY @"tzecy5lgatsbrvbt2ttfrxlelertfxywt3whes4q"
#define OAUTH_CONSUMER_SECRET_KEY @"eusfvy3oizylx11dr420nhxluv1rdan5qjjkgmkh"

#else

// Try with a different server - fill in details here:
#define ANOTHER_OBP_SERVER_HOST @"https://api-anotherserver.openbankproject.com/"
#define OAUTH_AUTHENTICATE_URL ANOTHER_OBP_SERVER_HOST
#define OAUTH_BASE_URL ANOTHER_OBP_SERVER_HOST @"obp/v1.3.0/"
// Try with a different server - fill in the details here:
#define ANOTHER_OBP_SERVER_HOST @"https://api-anotherserver.openbankproject.com/"

#define OAUTH_AUTHENTICATE_URL ANOTHER_OBP_SERVER_HOST
#define OAUTH_BASE_URL ANOTHER_OBP_SERVER_HOST @"obp/v3.0.0/"

// Get key and secret by registering your client at: ANOTHER_OBP_SERVER_HOST/consumer-registration
#define OAUTH_CONSUMER_KEY @"paste-your-consumer-key-here"
#define OAUTH_CONSUMER_SECRET_KEY @"paste-your-consumer-secret-here"
#define OAUTH_CONSUMER_KEY @"paste-your-consumer-key-here"
#define OAUTH_CONSUMER_SECRET_KEY @"paste-your-consumer-secret-here"

#endif

Expand All @@ -49,7 +51,7 @@ NS_INLINE NSDictionary* DefaultServerDetails()
OBPServerInfo_AuthServerBase : OAUTH_AUTHENTICATE_URL,
OBPServerInfo_ClientKey : OAUTH_CONSUMER_KEY,
OBPServerInfo_ClientSecret : OAUTH_CONSUMER_SECRET_KEY,
// ...this is insecure because this only a demo app, but your production app should retrieve your client key and secret from a secure storage place rather than plain text in the app.
// ...this is insecure because this only a demo app, but your production app should retrieve your client key and secret from a secure storage place rather than plain text in the app where they can easily be retrieved from the executable.
};
}

Expand Down
6 changes: 3 additions & 3 deletions HelloOBP-iOS/UI/LoginViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ - (void)viewDidLoad

self.title = @"Open Bank Project";

// 2. Get the default server info, and make a corresponding session to access it
_serverInfo = [OBPServerInfo defaultEntry];
_session = [OBPSession sessionWithServerInfo: _serverInfo];
// 2. Get the current session if already set, otherwise a session with the default server info
_session = [OBPSession currentSession] ?: [OBPSession sessionWithServerInfo: [OBPServerInfo defaultEntry]];
_serverInfo = _session.serverInfo;
_APIBase = _serverInfo.APIBase;

// 3. initialize the webview and add it to the view
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ use_frameworks!
target 'HelloOBP-iOS' do
pod 'OAuthCore', :git => 'https://github.com/t0rst/OAuthCore.git'
# ...OBPKit currently requires the t0rst fork of OAuthCore
pod 'OBPKit', :git => 'https://github.com/OpenBankProject/OBPKit-iOSX.git', :tag => '1.1.1'
pod 'OBPKit', :git => 'https://github.com/OpenBankProject/OBPKit-iOSX.git'
end

0 comments on commit 7c1ca1c

Please sign in to comment.