示例#1
0
        private async Task OnCreateTenantValidSubmitAsync(EditContext editContext)
        {
            try
            {
                await TenantService.CreateTenantAsync(createTenantForm.Model.Map <CreateTenantRequest>(afterMap =>
                {
                    afterMap.ControlClientBaseUri = RouteBindingLogic.GetBaseUri();
                }));

                createTenantDone = true;
                createTenantReceipt.Add("Tenant created.");
                createTenantReceipt.Add("Master track with user repository created.");
                createTenantReceipt.Add("Master track default login up-party created.");
                createTenantReceipt.Add("First master track administrator user created.");
                createTenantReceipt.Add("Master track FoxIDs Control API down-party created.");
                createTenantReceipt.Add("Master track FoxIDs Control client down-party created.");
                createTenantReceipt.Add("Test track with user repository created.");
                createTenantReceipt.Add("Production track with user repository created.");

                await NotificationLogic.TenantUpdatedAsync();
            }
            catch (FoxIDsApiException ex)
            {
                if (ex.StatusCode == System.Net.HttpStatusCode.Conflict)
                {
                    createTenantForm.SetFieldError(nameof(createTenantForm.Model.Name), ex.Message);
                }
                else
                {
                    throw;
                }
            }
        }
示例#2
0
        public (string, string, string) GetRedirectAndLogoutUrls(string partyName, PartyBindingPatterns partyBindingPattern)
        {
            var partyBinding = (partyName.IsNullOrEmpty() ? "--up-party-name--" : partyName.ToLower()).ToUpPartyBinding(partyBindingPattern);
            var oauthUrl     = $"{RouteBindingLogic.GetFoxIDsTenantEndpoint()}/{(RouteBindingLogic.IsMasterTenant ? "master" : TrackSelectedLogic.Track.Name)}/{partyBinding}/{Constants.Routes.OAuthController}/";

            return(oauthUrl + Constants.Endpoints.AuthorizationResponse, oauthUrl + Constants.Endpoints.EndSessionResponse, oauthUrl + Constants.Endpoints.FrontChannelLogout);
        }
示例#3
0
 private TenantViewModel ToViewModel(Tenant tenant)
 {
     return(tenant.Map <TenantViewModel>(afterMap: afterMap =>
     {
         afterMap.LoginUri = $"{RouteBindingLogic.GetBaseUri().Trim('/')}/{tenant.Name}".ToLower();
     }));
 }
示例#4
0
        protected override async Task OnInitializedAsync()
        {
            await RouteBindingLogic.InitRouteBindingAsync();

            await base.OnInitializedAsync();

            TrackSelectedLogic.OnShowSelectTrackAsync += OnShowSelectTrackAsync;
        }
示例#5
0
 private void ShowTenant(string tenantName)
 {
     tenantInfo.Name         = tenantName;
     tenantInfo.LoginUri     = $"{RouteBindingLogic.GetBaseUri().Trim('/')}/{tenantName}".ToLower();
     deleteTenantError       = null;
     deleteTenantAcknowledge = false;
     tenantModal.Show();
 }
示例#6
0
        protected override async Task OnInitializedAsync()
        {
            await RouteBindingLogic.InitRouteBindingAsync();

            trackSettingsHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/tracksettings";
            await base.OnInitializedAsync();

            TrackSelectedLogic.OnShowSelectTrackAsync += OnShowSelectTrackAsync;
        }
示例#7
0
文件: Logs.cs 项目: ITfoxtec/FoxIDs
        protected override async Task OnInitializedAsync()
        {
            logSettingsHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/logsettings";
            await base.OnInitializedAsync();

            TrackSelectedLogic.OnTrackSelectedAsync += OnTrackSelectedAsync;
            if (TrackSelectedLogic.IsTrackSelected)
            {
                await DefaultLoadAsync();
            }
        }
示例#8
0
        protected override async Task OnInitializedAsync()
        {
            downPartyHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/downparties";
            await base.OnInitializedAsync();

            TrackSelectedLogic.OnTrackSelectedAsync += OnTrackSelectedAsync;
            if (TrackSelectedLogic.IsTrackSelected)
            {
                await DefaultLoadAsync();
            }
        }
示例#9
0
        protected override async Task OnInitializedAsync()
        {
            upPartyHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/upparties";
            await base.OnInitializedAsync();

            await ControlClientSettingLogic.InitLoadAsync();

            TrackSelectedLogic.OnTrackSelectedAsync += OnTrackSelectedAsync;
            if (TrackSelectedLogic.IsTrackSelected)
            {
                await DefaultLoadAsync();
            }
        }
示例#10
0
        private async Task OnUpdateTenantValidSubmitAsync(EditContext editContext)
        {
            try
            {
                var myTenant = await MyTenantService.UpdateTenantAsync(tenantSettingsForm.Model.Map <MyTenantRequest>());

                toastService.ShowSuccess("Tenant settings updated.", "SUCCESS");
                savedCustomDomain = myTenant.CustomDomain;
                tenantSettingsForm.Model.CustomDomain         = myTenant.CustomDomain;
                tenantSettingsForm.Model.CustomDomainVerified = myTenant.CustomDomainVerified;
                RouteBindingLogic.SetMyTenant(myTenant);
            }
            catch (Exception ex)
            {
                tenantSettingsForm.SetError(ex.Message);
            }
        }
示例#11
0
        private async Task DefaultLoadAsync()
        {
            try
            {
                deleteTenantError       = null;
                deleteTenantAcknowledge = false;
                var myTenant = await MyTenantService.GetTenantAsync();

                savedCustomDomain = myTenant.CustomDomain;
                await tenantSettingsForm.InitAsync(myTenant.Map <TenantSettingsViewModel>());

                RouteBindingLogic.SetMyTenant(myTenant);
            }
            catch (TokenUnavailableException)
            {
                await(OpenidConnectPkce as TenantOpenidConnectPkce).TenantLoginAsync();
            }
            catch (Exception ex)
            {
                tenantSettingsForm.SetError(ex.Message);
            }
        }
示例#12
0
 public RiskPasswordService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic) : base(httpClientFactory, routeBindingLogic, trackSelectedLogic)
 {
 }
示例#13
0
 public BaseService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic, bool secureService = true)
 {
     httpClient              = httpClientFactory.CreateClient(secureService ? HttpClientSecureLogicalName : HttpClientLogicalName);
     this.routeBindingLogic  = routeBindingLogic;
     this.trackSelectedLogic = trackSelectedLogic;
 }
示例#14
0
        public string GetSamlMetadata(string partyName, PartyBindingPatterns partyBindingPattern)
        {
            var partyBinding = (partyName.IsNullOrEmpty() ? "--up-party-name--" : partyName.ToLower()).ToUpPartyBinding(partyBindingPattern);

            return($"{RouteBindingLogic.GetFoxIDsTenantEndpoint()}/{(RouteBindingLogic.IsMasterTenant ? "master" : TrackSelectedLogic.Track.Name)}/{partyBinding}/{Constants.Routes.SamlController}/{Constants.Endpoints.SamlSPMetadata}");
        }
示例#15
0
 public ClientService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic) : base(httpClientFactory, routeBindingLogic, trackSelectedLogic, false)
 {
 }
示例#16
0
 public DownPartyService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic) : base(httpClientFactory, routeBindingLogic, trackSelectedLogic)
 {
 }
示例#17
0
 public TenantOpenidConnectPkce(IServiceProvider serviceProvider, RouteBindingLogic routeBindingBase, ControlClientSettingLogic controlClientSettingLogic, ClientSettings clientSettings, OpenidConnectPkceSettings globalOpenidClientPkceSettings, NavigationManager NavigationManager, ISessionStorageService sessionStorage, AuthenticationStateProvider authenticationStateProvider) : base(serviceProvider, globalOpenidClientPkceSettings, NavigationManager, sessionStorage, authenticationStateProvider)
 {
     this.routeBindingBase          = routeBindingBase;
     this.controlClientSettingLogic = controlClientSettingLogic;
     this.clientSettings            = clientSettings;
 }