コード例 #1
0
        public OAuthRequest CreateRequest(OAuthEndPoint resourceEndPoint, Uri callbackUri, string verifier, string endUserId)
        {
            OAuthRequest request = new OAuthRequest(this, resourceEndPoint, verifier, new RequestStateKey(Service, endUserId));

            request.CallbackUrl = callbackUri;

            return request;
        }
コード例 #2
0
        public OAuthRequest CreateRequest(OAuthEndPoint resourceEndPoint, Uri callbackUri, string verifier, string endUserId)
        {
            OAuthRequest request = new OAuthRequest(this, resourceEndPoint, verifier, new RequestStateKey(Service, endUserId));

            request.CallbackUrl = callbackUri;

            return(request);
        }
コード例 #3
0
        public OAuthRequest CreateRequest(OAuthEndPoint resourceEndPoint, Uri callbackUri, IToken requestToken, string verifier, IToken accessToken)
        {
            RequestState state = new RequestState(new RequestStateKey(Service, null));

            state.RequestToken = requestToken;
            state.AccessToken  = accessToken;

            OAuthRequest request = new OAuthRequest(this, resourceEndPoint, verifier, state);

            request.CallbackUrl = callbackUri;
            return(request);
        }
コード例 #4
0
        public void TestSuccess1()
        {
            OAuthService       service       = new OAuthService(new OAuthEndPoint(RequestTokenAddress), AuthorizationAddress, new OAuthEndPoint(AccessTokenAddress), Consumer);
            OAuthClientContext clientContext = new OAuthClientContext(service);

            clientContext.NonceGenerator = new GuidNonceGenerator();

            UriBuilder builder = new UriBuilder();

            builder.Scheme = Uri.UriSchemeHttp;
            builder.Host   = PathServiceAddress.Host;
            builder.Port   = PathServiceAddress.Port;
            builder.Path   = PathName;

            OAuthRequest  consumerRequest = clientContext.CreateRequest(new OAuthEndPoint(builder.ToString(), "GET"));
            OAuthResponse resource        = consumerRequest.GetResource();

            if (resource.HasProtectedResource)
            {
                //TODO:
            }
        }
コード例 #5
0
        public OAuthRequest CreateRequest(OAuthEndPoint resourceEndPoint, Uri callbackUri, IToken requestToken, string verifier, IToken accessToken)
        {
            RequestState state = new RequestState(new RequestStateKey(Service, null));
            state.RequestToken = requestToken;
            state.AccessToken = accessToken;

            OAuthRequest request = new OAuthRequest(this, resourceEndPoint, verifier, state);
            request.CallbackUrl = callbackUri;
            return request;
        }