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

			this.state = state;
		}
        public void Store(RequestState state)
        {
            if (state == null)
                throw new ArgumentNullException("state");

            lock (SyncRoot) {
                states[state.Key] = state;
            }
        }
        public RequestState Get(RequestStateKey key)
        {
            if (key == null)
                throw new ArgumentNullException("key");

            lock (SyncRoot) {
                RequestState state;
                if (!states.TryGetValue(key, out state)) {
                    state = new RequestState(key);
                    Store(state);
                }

                return state;
            }
        }
示例#4
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;
        }
示例#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);
		}
示例#6
0
        internal OAuthRequest(OAuthClientContext context, OAuthEndPoint resourceEndPoint, string verifier, RequestState state)
        {
            this.context          = context;
            this.resourceEndPoint = resourceEndPoint;
            this.verifier         = verifier;

            this.state = state;
        }