Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional iOS Network Programming: Connecting the Enterprise to the iPhone and iPad
This is the forum to discuss the Wrox book Professional iOS Network Programming: Connecting the Enterprise to the iPhone and iPad by Jack Cox, Nathan Jones, John Szumski; ISBN: 978-1-118-36240-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional iOS Network Programming: Connecting the Enterprise to the iPhone and iPad section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 4th, 2012, 08:17 AM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with Chapter 6

Problems with getting the mobile banking app to work. I'm not a website person, so I loaded the index.php into the default folder on Mountain Lion Server. I changed your.banking.com to my ip address of the server. I also changed kResourceBaseURL to "https://192.168.1.114". It always just give me an unsecure connection. The challenge is always cancelled. Any ideas? Thanks.
Reply With Quote
  #2 (permalink)  
Old November 6th, 2012, 10:02 AM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey jlchapman - first, thanks for buying the book. I'd be happy to help you get started with chapter 6. Which operation are you trying to execute, the initial authenticate?

First, a couple things to check on the server, have you dropped the .htaccess file into the directory and ensured that is working by attempting to hit an endpoint - e.g. POSTing to https://192.168.1.114/path/to/index/authenticate/basic?

If that is up and running, the next thing to check are the domains in the validProtectionSpaces method in Model.m. If the authenticate method is failing you could also put a breakpoint at line 203 in the AuthenticateOperation.m file.

Let me know if that doesn't resolve the issue.
Reply With Quote
  #3 (permalink)  
Old November 7th, 2012, 07:47 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nathan, Thanks for replying. Due to my work load, I wont be able to get back to this problem until Friday.

Thanks, Jerry
Reply With Quote
  #4 (permalink)  
Old November 7th, 2012, 09:22 PM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Definitely Jerry. Just post back here if you continue to have issues after you review and we'll get things sorted out.

Nate
Reply With Quote
  #5 (permalink)  
Old November 9th, 2012, 07:09 PM
Registered User
Points: 12, Level: 1
Points: 12, Level: 1 Points: 12, Level: 1 Points: 12, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Nathan,

I'm a newby when it comes to websites and php.
I compiled the code and downloaded to my iPhone 5, no changes except as noted below.
I have the .htaccess file in the default directory with index.php and utils.php
<Directory"/Library/WebServer/Documents">section and change to AllowOverride All so that .htaccess files will work.
I also restarted apache.
In Safari I tried http://192.168.1.114/index/authenticate/basic
OR http://192.168.1.114/index.php
it returned {"result":"ERROR","additional_info":"Invalid request. You are not authorized. Token is invalid."}

#define kResourceBaseURL @"http://192.168.1.114"
I'm using username = 'user' password = 'basic'
In authenticateOperation.m I added a nslog after the following in start method
url = [kResourceBaseURL stringByAppendingString:kEndpoint];
NSLog(@"url = %@",url);
output is url = http://192.168.1.114/user/authenticate

I get the alert showing 'Login Failed' invalid username or password when trying to login.

Hope this helps, Jerry
Reply With Quote
  #6 (permalink)  
Old November 18th, 2012, 09:40 PM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Jerry - first, sorry it took so long to get back to you.

Ok, let's check a few things.
1) I'm assuming the cert you're using is self-signed, is that accurate? If so, the likely culprit is that Apple doesn't trust it and thus you're failing the underlying NSURLConnection security checks. You should add the certificate to your device - easiest way is to email it to yourself and install the cert.
2) I noticed a couple differences in the url's you listed above. The one you hit in your browser was */index/authenticate/basic and the one in the app was */user/authenticate. You should be hitting */user/authenticate.
3) Did you update the values in the method validProtectionSpaces to match your address? Try setting a breakpoint (or logging something) in the connection:willSendRequestForAuthenticationChallen ge: method (line 204) in the AuthenticateOperation implementation
4) Also, have you tried hitting your service with a web service test client like HTTP Client (in the mac appstore) or a chrome plugin like https://chrome.google.com/webstore/d...jhfbgofnpcjmb? If not, try that and see what the result is. We're just trying to narrow down where it's failing.

Let me know how things go. I will keep an eye on it this week.
Reply With Quote
  #7 (permalink)  
Old October 6th, 2014, 05:20 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up Nathan, could you please post a brief instructions on how to install the server tier?

Server tier installation on your Chapter 6 sample app?

Thanks a lot,
James
Reply With Quote
  #8 (permalink)  
Old October 7th, 2014, 09:47 PM
Wrox Author
Points: 61, Level: 1
Points: 61, Level: 1 Points: 61, Level: 1 Points: 61, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 6 Services

Hey James - thanks for the note, but I'm not totally sure what you need. Chapter 6 contains a series of PHP scripts. Have you tried deploying the scripts to a PHP enabled server? If this is for development testing purposes, localhost or even a shared host should suffice.

Hope that helps,
Nate
Reply With Quote
  #9 (permalink)  
Old October 8th, 2014, 04:10 PM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you could post brief instruction on "deploying the scripts to a PHP enabled local host on Mac", that will save readers lots of hours.

Thanks, James


Quote:
Originally Posted by nathanhjones View Post
Hey James - thanks for the note, but I'm not totally sure what you need. Chapter 6 contains a series of PHP scripts. Have you tried deploying the scripts to a PHP enabled server? If this is for development testing purposes, localhost or even a shared host should suffice.

Hope that helps,
Nate
Reply With Quote
  #10 (permalink)  
Old October 30th, 2014, 02:59 AM
Registered User
Points: 9, Level: 1
Points: 9, Level: 1 Points: 9, Level: 1 Points: 9, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

on page 149
LISTING 6-20: Handling AES Encrypted Responses (/App/Mobile-Banking/ GetAccountsOperation.m)

Your code made MAC validation
Code:
 if ([inboundMAC isEqualToString:generatedMAC]) { ...
after
Code:
 calling decryptedWithAESUsingKey:kAESEncryptionKey andIV:ivData];
I think the order should be opposite? because if MACs don't match, game is over, NO expensive decryptions should ever perform...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 6 - problems kent1975 BOOK: Beginning ASP.NET 4 : in C# and VB 5 January 16th, 2011 08:28 AM
Problems with chapter 1 macuser BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 2 April 2nd, 2009 12:39 PM



All times are GMT -4. The time now is 12:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.