示例#1
0
    protected virtual async Task <string> GetAccessTokenOrNullAsync(string identityClientName)
    {
        var configuration = ClientOptions.GetClientConfiguration(CurrentTenant, identityClientName);

        if (configuration == null)
        {
            Logger.LogWarning($"Could not find {nameof(IdentityClientConfiguration)} for {identityClientName}. Either define a configuration for {identityClientName} or set a default configuration.");
            return(null);
        }

        return(await GetAccessTokenAsync(configuration));
    }