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