Example #1
0
 public AzureContext(ILogProvider logProvider, IStatusProvider statusProvider, ISettingsProvider settingsProvider)
 {
     _LogProvider      = logProvider;
     _StatusProvider   = statusProvider;
     _SettingsProvider = settingsProvider;
     _TokenProvider    = new AzureTokenProvider(_LogProvider);
     _AzureRetriever   = new AzureRetriever(this);
 }
Example #2
0
        //internal void SetAzureContext(AzureContext azureContext)
        //{
        //    this.AzureEnvironment = azureContext.AzureEnvironment;
        //    _AzureRetriever = azureContext.AzureRetriever;
        //    _TokenProvider = azureContext.TokenProvider;

        //    if (this.TokenProvider != null)
        //    {
        //        UserAuthenticated?.Invoke(this.TokenProvider.AuthenticationResult.UserInfo);
        //    }
        //}

        public async Task Logout()
        {
            if (BeforeUserSignOut != null)
            {
                await BeforeUserSignOut.Invoke();
            }

            await this.SetSubscriptionContext(null);

            _AzureRetriever = null;
            _TokenProvider  = null;

            if (AfterUserSignOut != null)
            {
                await AfterUserSignOut?.Invoke();
            }
        }
Example #3
0
        public async Task Login()
        {
            this.TokenProvider = await AzureTokenProvider.LoginAzureProvider(this.AzureEnvironment);

            this._AzureRetriever = new AzureRetriever(this);
        }