/// <summary>
 /// Creates a new OAuth protected request configured for an ASP.NET context,
 /// with the the current user or session id used as a state key.
 /// </summary>
 /// <param name="resourceEndPoint">Protected resource End Point</param>
 /// <param name="settings">Service settings</param>
 /// <param name="callbackUri">Callback URI</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)
 {
     return(AspNetOAuthRequest.Create(
                resourceEndPoint,
                settings,
                callbackUri,
                GetEndUserIdFromHttpContextUser() ?? GetEndUserIdFromHttpSession()));
 }
        /// <summary>
        /// Creates a new OAuth protected request configured for an ASP.NET context,
        /// with the current URL as the callback URL and the current user or session id
        /// used as a state key.
        /// </summary>
        /// <param name="resourceEndPoint">Protected resource End Point</param>
        /// <param name="settings">Service settings</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)
        {
            HttpContext context = HttpContext.Current;

            return(AspNetOAuthRequest.Create(
                       resourceEndPoint,
                       settings,
                       context.Request.Url,
                       GetEndUserIdFromHttpContextUser() ?? GetEndUserIdFromHttpSession()));
        }