public void AuthorizeTestInvalidAuthCode() { var completion = new ManualResetEvent(false); var response = new WebexApiEventArgs(); var auth = new OAuthAuthenticator(clientId, clientSecret, scope, redirectUri); auth.Authorize("a.b.c", r => { response = r; completion.Set(); }); if (!completion.WaitOne(30000)) { Assert.Fail(); } Assert.IsFalse(response.IsSuccess); }
public void AuthorizeByOAuthAccessToken(string authCode) { GettingAuthCode = false; IsBusy = true; OAuthAuthenticator auth = ApplicationController.Instance.CurSparkManager.CurAuthenticator as OAuthAuthenticator; auth?.Authorize(authCode, result => { IsBusy = false; if (result.IsSuccess) { output("authorize success!"); ApplicationController.Instance.ChangeState(State.Main); } else { output("authorize failed!"); } }); }