// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using IdentityServer4.Services;
using IdentityServer4.Stores;
using IdentityServer4.Validation;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
namespace IdentityServer4.ResponseHandling
{
///
/// The default token response generator
///
///
public class TokenResponseHandler : TokenResponseGenerator, ITokenResponseGenerator
{
///
/// Initializes a new instance of the class.
///
/// The clock.
/// The token service.
/// The refresh token service.
/// The scope parser.
/// The resources.
/// The clients.
/// The logger.
public TokenResponseHandler(ISystemClock clock, ITokenService tokenService, IRefreshTokenService refreshTokenService, IScopeParser scopeParser, IResourceStore resources, IClientStore clients, ILogger logger)
: base(clock, tokenService, refreshTokenService, scopeParser, resources, clients, logger)
{
}
protected override async Task ProcessRefreshTokenRequestAsync(TokenRequestValidationResult request)
{
var response = await base.ProcessRefreshTokenRequestAsync(request);
// Fixes: https://github.com/IdentityServer/IdentityServer3/issues/3621
response.IdentityToken = null;
return response;
}
}
}