示例#1
0
        public async Task <IToken> AddToken(IScope scope, string code)
        {
            EveToken token = await EveAuthentication.GetWebToken(scope, code, ClientID, ClientSecret);

            AddToken(token);

            return(token);
        }
示例#2
0
        /// <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);
        }
示例#3
0
        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);
            }
        }
示例#4
0
        /// <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);
        }