示例#1
0
		internal OAuthRequest(OAuthClientContext context, OAuthEndPoint resourceEndPoint, string verifier, RequestState state) {
			this.context = context;
			this.resourceEndPoint = resourceEndPoint;
			this.verifier = verifier;

			this.state = state;
		}
示例#2
0
 internal OAuthRequest(OAuthClientContext context, OAuthEndPoint resourceEndPoint, string verifier, RequestStateKey stateKey)
 {
     this.context          = context;
     this.resourceEndPoint = resourceEndPoint;
     this.verifier         = verifier;
     state = context.RequestStateStore.Get(stateKey);
 }
示例#3
0
        internal OAuthRequest(OAuthClientContext context, OAuthEndPoint resourceEndPoint, string verifier, RequestState state)
        {
            this.context          = context;
            this.resourceEndPoint = resourceEndPoint;
            this.verifier         = verifier;

            this.state = state;
        }
示例#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
		internal OAuthRequest(OAuthClientContext context, OAuthEndPoint resourceEndPoint, string verifier, RequestStateKey stateKey) {
			this.context = context;
			this.resourceEndPoint = resourceEndPoint;
			this.verifier = verifier;
			state = context.RequestStateStore.Get(stateKey);
		}
        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:
            }
        }