Rename accesstoken to tokensecret

Aug 29, 2011 at 3:18 PM

The IOAuthCredentials interface has the following four properties:

string ConsumerKey { get; set; }

string ConsumerSecret { get; set; }

string OAuthToken { get; set; }

string AccessToken { get; set; }

I think the AccessToken property should be renamed to TokenSecret as that's what it seems to represent.

For example in OAuthAuthorizer.cs we have this:

public IOAuthCredentials Credentials
{
	get
	{
		if (m_credentials != null && m_credentials.AccessToken == null)
		{
			m_credentials.AccessToken = OAuthTwitter.OAuthTokenSecret;
		}

		return m_credentials;
	}
	set
	{
		m_credentials = value;
		OAuthTwitter.OAuthToken = value.OAuthToken;
		OAuthTwitter.OAuthTokenSecret = value.AccessToken;
	}
}

Or have I misunderstood something?

Coordinator
Aug 29, 2011 at 3:56 PM

Hi,

This is something I've thought about a few times because of the confusion it's caused.  The history of this is that the original OAuth source code is borrowed from another open-source project that was built in the earlier days of OAuth.  Some of the naming conventions have changed in the meantime, leaving a mismatch between official specification documentation, Twitter naming, and LINQ to Twitter naming.  This is currently based on OAuth 1.0a.  OAuth 2 is already being implemented by many API's accross the Internet and the naming is different for that.

So, I agree with you're point of view, that the naming of AccessToken isn't optimal.

The consequences of renaming the property at this point in time is that a lot of people are using the code as is.  A naming change would be a breaking change.  This affects a large group of people who regularly update when I release a new version.  Also (as a somewhat humorous observation), if I renamed the property, it's inevitable that someone else would think the name should be different.

@JoeMayo

Oct 18, 2011 at 11:43 AM

Ah, thanks for clarifying that.

I understand your reasons for leaving it as it is now.

I'll just add some comments to my code as a reminder.

Thank you for the quick response and sorry for my rather late reply. :)