Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7013003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:19:47+00:00 2026-05-27T22:19:47+00:00

I am developing an App that will interface with a web server (PHP with

  • 0

I am developing an App that will interface with a web server (PHP with MySQL back end) using web views. I have the application working with static URL’s as tests, but now I need to adjust for actual user interaction.

I have been looking for solutions to HTTP authentication but believe the phrase to be incorrect as most of the search results I get are all related to “REST” requests. I will be using a URL (PHP / MySQL) to validate authentication and do not believe that qualifies as REST based on my experience.

I do not have SSL as of yet on this server so I am not sure what options are available via Cocoa.

Questions I have:

  1. Is there a way to create a View that loads if the account ID isn’t already stored locally?

  2. If so, can i code the app to supersede the storyboard I have created if authentication is needed?

  3. If step 1 and 2 work, how can I interface with my web server to authenticate? ( preferred method is to submit user email and the MD5 of the password as that is what is currently stored in the database)

Ideally i would love to just submit a url like “login.php?login=me@blah.com&password=(md5hash)” and have the provided response either give me “auth=true&accountID=5” or “auth=false” … then use the iPhone app to either report an auth error to the user or save the account id to NSUserDefaults for future use (to bypass auth later) and load the normal storyboard already in place.

Any recommendations would be appreciated.

Thanks,

Silver Tiger

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:19:48+00:00Added an answer on May 27, 2026 at 10:19 pm

    You are pretty close with your thinking. I use a very similar approach to my user login process.

    I currently salt and hash the email and password into 1 40 char token. If the login returns successful, I save the token to NSUserDefaults. I use this token for all other web requests going forward until the user logs out, at which time I delete the user defaults.

    Here are a few snippets I use for the same process:

    // see if a login already exists
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    self.token = [defaults stringForKey:@"token"];
    
    // if the token is nil/blank, launch login view
    if(self.token == nil || [self.token isEqualToString:@""]) {
        [self loadStartView];
        return;
    }
    
    // build the request to update status
    [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyNever];
    NSString *stringData = [NSString stringWithFormat:@"<your api string here"];
    NSString *requestData = stringData;
    NSData *myRequestData = [NSData dataWithBytes: [requestData UTF8String] length: [requestData length]];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:[NSString  stringWithFormat:@"<your url request here>"]]];
    [request setHTTPMethod: @"POST"];
    [request setHTTPBody: myRequestData];
    NSData *jsonData = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil];
    NSString *json = [[[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding] autorelease];
    NSDictionary *payloadData = [json JSONValue];
    
    [request release];
    
    if([[payloadData objectForKey:@"success"] boolValue]) { // this is designed around my api, but you get the idea
        //NSLog(@"updateStatus: %@", payloadData);
        // updates the api version for every call
        [defaults setObject:self.token forKey:@"token"];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web app (using rails) that I will be launching within
We are developing the Web App that will have user subscription to a specific
I'm developing a client/server app that will communicate via rest. Some custom request data
I'm developing web app that user can save his/her work to server. The data
I'm developing a web app that will show the location of a project in
We are developing an app that consists of a web server that hosts a
I'm developing a web app that will access and work with large amounts of
I have a multiview iPhone app I'm developing that will have lots of inputs
When developing an app that will listen on a TCP/IP port, how should one
I am developing a web app but is not satisfied with is architecture that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.