public static IOAuthSession CreateSession(OAuthCredentials credentials, string oAuthBaseUrl, string callbackUrl) { var consumerContext = new OAuthConsumerContext { ConsumerKey = credentials.ConsumerKey, ConsumerSecret = credentials.ConsumerSecret }; return new OAuthSession( consumerContext, GetRequestTokenEndpointUrl(oAuthBaseUrl), GetAuthorizeEndpointUrl(oAuthBaseUrl), GetAccessTokenEndpointUrl(oAuthBaseUrl), callbackUrl); }
/// <summary> /// Instantiate a new <see cref="OAuthRestClient"/> /// </summary> /// <param name="credentials">OAuth credentials to use when signing requests.</param> /// <param name="baseUrl">Url needed when accessing building URLs for /// accessing the OAuthCredentialService</param> public OAuthRestClient(OAuthCredentials credentials, string baseUrl) { this.credentials = credentials; this.baseUrl = baseUrl; }
public OAuthService(string consumerKey, string consumerSecret, string baseUrl, string callbackUrl) { credentials = new OAuthCredentials(consumerKey, consumerSecret); session = CreateSession(credentials, baseUrl, callbackUrl); }