fornaxM / mpoauthconnection

Automatically exported from code.google.com/p/mpoauthconnection
0 stars 0 forks source link

Flush keychain and restore authentication state to fresh-out-of-box #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Would love a way to restore the authentication state to default. Useful
both for testing the pre-authentication UX as well as to give the user the
ability to switch accounts or revoke authentication.

As Karl put it, a -removeCredentials API.

Original issue reported on code.google.com by weeb...@gmail.com on 9 Apr 2009 at 5:25

GoogleCodeExporter commented 9 years ago
Dove into the code and took a stab at writing the method that might do this:

- (void)flushCredentials
{
    [self removeValueFromKeychainUsingName:@"oauth_token_request"];
    [self removeValueFromKeychainUsingName:@"oauth_token_request_secret"];
    [self removeValueFromKeychainUsingName:@"oauth_token_access"];
    [self removeValueFromKeychainUsingName:@"oauth_token_access_secret"];
    [self removeValueFromKeychainUsingName:@"oauth_session_handle"];
}

Even calling this method before the meat of initWithCredentials was run didn't 
seem
to reset the authentication state. Any guess where I'm going wrong here?

Original comment by weeb...@gmail.com on 11 Apr 2009 at 2:29

GoogleCodeExporter commented 9 years ago

Original comment by karl.a...@gmail.com on 12 Apr 2009 at 8:06