views:

67

answers:

1

I am calling a REST service that requires basic auth and I respond to the didReceiveAuthenticationChallenge delegate OK

    NSURLCredential *credential = [[NSURLCredential alloc] initWithUser:self.user password:self.password persistence:NSURLCredentialPersistenceForSession];
    [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
    [credential release];

The Credentials are valid for the Session but I would like for my App to be able to switch between servers and therefore need to "reset" the Session so it asks again for a challenge.

I can of course try the option of not storing the credentials for the Session and supply them for each call but this does not seem like a good idea.

Any ideas would be appreciated!

A: 

Hi John, I have the same challenge here. I want to reset connection from iPhone to the REST API service that using HTTP Basic Authentication. I want user to be able to log out. Anytime I make my app (client side) "forget" the user credentials, the session keeps the user logged in.

Have you found any workarounds on this?

P.S. I know I should post it in comments as this is not an answer, but I just have not enough "reputaion" to do it, and I don't like double posts.

Ivan