public override void ExecuteCmdlet() { base.ExecuteCmdlet(); var config = new AzureADConfig() { ClientId = this.AppId, ClientSecret = this.AppSecret, RedirectUri = ResourceUri ?? AzureADConstants.GraphResourceId, AuthenticationEndpoint = Environment, TenantDomain = this.AADDomain, TenantId = AADTenantId ?? "" }; var ilogger = new DefaultUsageLogger(LogVerbose, LogWarning, LogError); var authenticationEndpoint = Environment.GetAzureADLoginEndPoint(); var endpoint = string.Format(AzureADConstants.AuthorityTenantFormat, authenticationEndpoint, this.AADDomain); AzureADALv1Connection.CurrentConnection = new AzureADALv1Connection(endpoint, config, ilogger); // Write Tokens to Console WriteObject(AzureADALv1Connection.CurrentConnection.AuthenticationResult); }
public SecureController(IAuthorizationService authorizationService, IOptions <AzureADConfig> azureAdConfig, ILogger <SecureController> logger) { _authorizationService = authorizationService; _azureADConfig = azureAdConfig.Value; _logger = logger; }
public DbTokenCache(TodoListWebAppContext db, IHttpContextAccessor httpContextAccessor, IOptions <AzureADConfig> aadConfig) { this.BeforeAccess = BeforeAccessNotification; this.AfterAccess = AfterAccessNotification; this.BeforeWrite = BeforeWriteNotification; _aadConfig = aadConfig.Value; _userId = httpContextAccessor.HttpContext.User.FindFirst(AzureADConstants.ObjectIdClaimType).Value; string tenantId = httpContextAccessor.HttpContext.User.FindFirst(AzureADConstants.TenantIdClaimType).Value; _authContext = new AuthenticationContext(String.Format(_aadConfig.AuthorityFormat, tenantId), this); _appCredentials = new ClientCredential(_aadConfig.ClientId, _aadConfig.ClientSecret); }
public override void ExecuteCmdlet() { base.ExecuteCmdlet(); var config = new AzureADConfig() { ClientId = this.AppId, ClientSecret = this.AppSecret, RedirectUri = AzureADConstants.GraphResourceId, TenantDomain = this.AADDomain, TenantId = "" }; var ilogger = new DefaultUsageLogger(LogVerbose, LogWarning, LogError); AzureADALv1Connection.CurrentConnection = new AzureADALv1Connection(config, ilogger); // Write Tokens to Console WriteObject(AzureADALv1Connection.CurrentConnection.AuthenticationResult); }
public UserProfileController(IOptions <AzureADConfig> config, IAzureAdTokenService tokenCache) { _aadConfig = config.Value; _tokenCache = tokenCache; }
/// <summary> /// Initialize the Azure AD Connection with config and diagnostics /// </summary> /// <param name="authenticationEndpoint">The authentication endpoint used to send the user to an Azure AD login screen</param> /// <param name="azureADCredentials"></param> /// <param name="traceLogger"></param> public AzureADALv1Connection(string authenticationEndpoint, AzureADConfig azureADCredentials, ITraceLogger traceLogger) { _iLogger = traceLogger; AzureADCache = new AzureADTokenCache(authenticationEndpoint, azureADCredentials, traceLogger); AzureADCredentials = azureADCredentials; }
public AuthorizeController(IOptions <AzureADConfig> azureAD) { this.azureAD = azureAD.Value; }
/// <summary> /// Initialize the Azure AD Connection with config and diagnostics /// </summary> /// <param name="azureADCredentials"></param> /// <param name="traceLogger"></param> public AzureADALv1Connection(AzureADConfig azureADCredentials, ITraceLogger traceLogger) { _iLogger = traceLogger; AzureADCache = new AzureADTokenCache(azureADCredentials, traceLogger); AzureADCredentials = azureADCredentials; }