public async Task<bool> Claim(Uri uri, string documentTitle) { //_token = HubiCHelper.GetAccessTokenFromFragment(uri); string code = null; foreach (var pair in uri.Query.TrimStart('?').Split('&')) { var elements = pair.Split('='); if (elements.Length != 2) { continue; } switch (elements[0]) { case "code": code = Uri.UnescapeDataString(elements[1]); break; } } if (code == null) return false; _token = await HubiCHelper.ProcessCodeFlowAsync(code); return _token != null; }
public void OnTokenUpdated(string access_token, string refresh_token, DateTime expires_in) { _token = new OAuth2Token(access_token, "bearer", null, refresh_token); }