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 8865219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:26:55+00:00 2026-06-14T16:26:55+00:00

NSURLCredential *credential2 = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust credentialWithUser: @username password: @password persistence:NSURLCredentialPersistenceNone]; [challenge.sender useCredential:credential2 forAuthenticationChallenge:challenge]; I

  • 0
    NSURLCredential *credential2 = [NSURLCredential
                  credentialForTrust:challenge.protectionSpace.serverTrust
                  credentialWithUser: @"username"
                                            password: @"password"
                                         persistence:NSURLCredentialPersistenceNone];


    [challenge.sender useCredential:credential2 forAuthenticationChallenge:challenge];

I need to bypass a self signed certificate with a UIWebView while also being able to pass in a username and a password for authentication.

 NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];

and

NSURLCredential *credential = [NSURLCredential credentialWithUser:
@”username” password: @”password”
persistence:NSURLCredentialPersistenceNone];

are both valid alone both they fuss when I try to combine them… Any ideas?

  • 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-06-14T16:26:56+00:00Added an answer on June 14, 2026 at 4:26 pm

    Used RestKit and the code below along with an alertView for login credentials to solve this issue.

    - (id)initWithURL:(NSURL*)pageURL {
    
        _retainedURL = pageURL;
        [_retainedURL retain];
    
        RKClient *client;
        NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
        client = [RKClient clientWithBaseURL: pageURL];
        client.username=[userDefaults objectForKey:@"UserName"];
        client.password=[userDefaults objectForKey:@"Password"];
        client.authenticationType=RKRequestAuthenticationTypeHTTPBasic;
        client.disableCertificateValidation= TRUE;
        RKRequest *request=[RKRequest requestWithURL:pageURL delegate:self];
        [client configureRequest:request];
        request.authenticationType = RKRequestAuthenticationTypeHTTPBasic;
        request.disableCertificateValidation = TRUE;
        self.authenticatedRequest = request;
        [request sendAsynchronously];
    
        if(self = [super init]) {
            self.URL = pageURL;
            self.availableActions = SVWebViewControllerAvailableActionsOpenInSafari | SVWebViewControllerAvailableActionsMailLink | SVWebViewControllerAvailableActionsCopyLink;
        }
        return self;
    }
    

    The login alertView adds the text for username and password to userdefaults and passes the retained URL back into the initWithURL function. The login alertview is being called when a page isn’t authenticated (with login credentials).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is NSURLCredential a safe way to send a password over a https connection when
I am trying to delete a NSURLCredential that is written when I access a
I need to invoke an initial GET HTTP request with Basic Authentication . This
I need to make an HTTPS request from my application in order to fetch
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]; } - (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge
I'm using NSMutableURLRequest to post some data to a password protected web server. I've
I'm trying to connect to http://cmis.demo.nuxeo.org/nuxeo/atom/cmis/ with NSURLConnection . This demo web service is
I am using Synchronous request and passing the credentials but I am getting authentication
I am trying to make Twitter work in my app and everything works fine
I have an app that communicates with a server that uses HTTP Digest authentication.

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.