public class SaasApiClientCredentialBuilder()

in src/Saas.Lib/Saas.Identity/Extensions/SaasIdentityConfigurationBuilderExtensions.api.cs [48:67]


public class SaasApiClientCredentialBuilder<TProvider, TOptions>(IServiceCollection services)
    where TProvider : ISaasApi
    where TOptions : AzureAdB2CBase
{
    private readonly IServiceCollection _services = services;

    public IServiceCollection AddMicrosoftGraphAuthenticationProvider()
    {
        if (typeof(TProvider).Equals(typeof(ISaasMicrosoftGraphApi)))
        {
            _services.AddScoped<IAuthenticationProvider, SaasGraphClientCredentialsProvider<TOptions>>();
        }
        else
        {
            throw new ArgumentException($"Provider type is of {typeof(TProvider)}, to add Microsoft Graph Autentication provider it must be of type {typeof(ISaasMicrosoftGraphApi)}");
        }
        
        return _services;
    }
}