/// <summary>
 /// Creates a new OAuth protected requests.
 /// </summary>
 /// <remarks>
 /// Since neither a request token nor an access token is supplied,
 /// the user will have to authorize this request.
 /// </remarks>
 /// <param name="resourceEndPoint">Protected resource End Point</param>
 /// <param name="settings">Service settings</param>
 /// <returns>An OAuth protected request for the protected resource</returns>
 public static OAuthRequest Create(EndPoint resourceEndPoint, OAuthService settings)
 {
     return(OAuthRequest.Create(
                resourceEndPoint,
                settings,
                new EmptyToken(settings.Consumer.Key, TokenType.Access),
                new EmptyToken(settings.Consumer.Key, TokenType.Request)));
 }
Example #2
0
 /// <summary>
 /// Creates a new OAuth protected request, initialised with previously
 /// retrieved request and access tokens, the specified callback
 /// </summary>
 /// <remarks>
 /// If the access token is valid, the user should not have to intervene
 /// to authorize the request and the protected resource should be
 /// fetched immediately.
 /// </remarks>
 /// <param name="resourceEndPoint">Protected resource End Point</param>
 /// <param name="settings">Service settings</param>
 /// <param name="callbackUri">Callback uri</param>
 /// <param name="requestToken">Request token</param>
 /// <param name="accessToken">Access token</param>
 /// <returns>An OAuth protected request for the protected resource,
 /// initialised with the request token and access token</returns>
 public static OAuthRequest Create(
     EndPoint resourceEndPoint,
     OAuthService settings,
     Uri callbackUri,
     IToken requestToken,
     IToken accessToken)
 {
     return(OAuthRequest.Create(resourceEndPoint, settings, callbackUri, requestToken, null, accessToken));
 }
        /// <summary>
        /// Creates a new OAuth protected request configured for an ASP.NET context.
        /// </summary>
        /// <param name="resourceEndPoint">Protected resource End Point</param>
        /// <param name="settings">Service settings</param>
        /// <param name="callbackUri">Callback URI</param>
        /// <param name="endUserId">End user ID</param>
        /// <returns>An OAuth protected request for the protected resource,
        /// configured for an ASP.NET context</returns>
        public static OAuthRequest Create(EndPoint resourceEndPoint, OAuthService settings, Uri callbackUri, string endUserId)
        {
            OAuthRequest request = OAuthRequest.Create(resourceEndPoint, settings, callbackUri, endUserId);

            request.AuthorizationHandler = AspNetOAuthRequest.HandleAuthorization;
            request.VerificationHandler  = AspNetOAuthRequest.HandleVerification;

            return(request);
        }
Example #4
0
 /// <summary>
 /// Creates a new OAuth protected request, using the supplied end user ID
 /// in combination with the service to create a state key to load and
 /// store request state such as tokens.
 /// </summary>
 /// <param name="resourceEndPoint">Protected resource End Point</param>
 /// <param name="settings">Service settings</param>
 /// <param name="callbackUri">Callback URI</param>
 /// <param name="endUserId">End user ID</param>
 /// <returns>An OAuth protected request for the protected resource,
 /// initialised using the configured state store</returns>
 public static OAuthRequest Create(EndPoint resourceEndPoint, OAuthService settings, Uri callbackUri, string endUserId)
 {
     return(OAuthRequest.Create(resourceEndPoint, settings, callbackUri, null, endUserId));
 }
Example #5
0
 /// <summary>
 /// Creates a new OAuth protected request, initialised with a previously
 /// retrieved request token. This token may or may not have been authorized.
 /// </summary>
 /// <remarks>
 /// If the request token supplied has not been authorized, the user will
 /// have to be directed to authorize it before the request can proceed.
 /// </remarks>
 /// <param name="resourceEndPoint">Protected resource End Point</param>
 /// <param name="settings">Service settings</param>
 /// <param name="requestToken">Request token</param>
 /// <returns>An OAuth protected request for the protected resource</returns>
 public static OAuthRequest Create(EndPoint resourceEndPoint, OAuthService settings, IToken requestToken)
 {
     return(OAuthRequest.Create(resourceEndPoint, settings, requestToken, null));
 }