public async Task <IToken> AddToken(IScope scope, string code) { EveToken token = await EveAuthentication.GetWebToken(scope, code, ClientID, ClientSecret); AddToken(token); return(token); }
/// <summary> /// Create a new token with scope. (Auto opens URL in browser) /// </summary> /// <param name="scope"></param> /// <returns></returns> public async Task <IToken> AddToken(IScope scope) { EveToken token = await EveAuthentication.CreateToken(scope, ClientID, Callback, Client); AddToken(token); return(token); }
void AddToken(EveToken token) { if (userTokens.TryGetValue(token.Name, out List <IToken> list)) { list.Add(token); } else { list = new List <IToken>(); list.Add(token); userTokens.Add(token.Name, list); } }
/// <summary> /// Get response from auth url and add the token. /// </summary> /// <param name="scope"></param> /// <param name="state"></param> /// <param name="verfier"></param> async void AddResponse(IScope scope, string state, string verfier) { EveToken token = await EveAuthentication.ValidateResponse(scope, Callback, state, verfier, ClientID); AddToken(token); }