public async Task <bool> RemoveAccessToken(string accessToken)
        {
            if (string.IsNullOrWhiteSpace(accessToken))
            {
                throw new ArgumentNullException(nameof(accessToken));
            }

            var tokenId = await _storage.GetValue("access_token_" + accessToken);

            if (string.IsNullOrWhiteSpace(tokenId))
            {
                return(false);
            }

            await _storage.RemoveAsync("access_token_" + accessToken);

            return(true);
        }
예제 #2
0
        public async Task <bool> RemoveAuthorizationCode(string code)
        {
            if (string.IsNullOrWhiteSpace(code))
            {
                throw new ArgumentNullException(code);
            }

            var authCode = await _storage.TryGetValueAsync <AuthorizationCode>(code);

            if (authCode == null)
            {
                return(false);
            }

            await _storage.RemoveAsync(code);

            return(true);
        }