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; } } }
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); }
private TenantViewModel ToViewModel(Tenant tenant) { return(tenant.Map <TenantViewModel>(afterMap: afterMap => { afterMap.LoginUri = $"{RouteBindingLogic.GetBaseUri().Trim('/')}/{tenant.Name}".ToLower(); })); }
protected override async Task OnInitializedAsync() { await RouteBindingLogic.InitRouteBindingAsync(); await base.OnInitializedAsync(); TrackSelectedLogic.OnShowSelectTrackAsync += OnShowSelectTrackAsync; }
private void ShowTenant(string tenantName) { tenantInfo.Name = tenantName; tenantInfo.LoginUri = $"{RouteBindingLogic.GetBaseUri().Trim('/')}/{tenantName}".ToLower(); deleteTenantError = null; deleteTenantAcknowledge = false; tenantModal.Show(); }
protected override async Task OnInitializedAsync() { await RouteBindingLogic.InitRouteBindingAsync(); trackSettingsHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/tracksettings"; await base.OnInitializedAsync(); TrackSelectedLogic.OnShowSelectTrackAsync += OnShowSelectTrackAsync; }
protected override async Task OnInitializedAsync() { logSettingsHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/logsettings"; await base.OnInitializedAsync(); TrackSelectedLogic.OnTrackSelectedAsync += OnTrackSelectedAsync; if (TrackSelectedLogic.IsTrackSelected) { await DefaultLoadAsync(); } }
protected override async Task OnInitializedAsync() { downPartyHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/downparties"; await base.OnInitializedAsync(); TrackSelectedLogic.OnTrackSelectedAsync += OnTrackSelectedAsync; if (TrackSelectedLogic.IsTrackSelected) { await DefaultLoadAsync(); } }
protected override async Task OnInitializedAsync() { upPartyHref = $"{await RouteBindingLogic.GetTenantNameAsync()}/upparties"; await base.OnInitializedAsync(); await ControlClientSettingLogic.InitLoadAsync(); TrackSelectedLogic.OnTrackSelectedAsync += OnTrackSelectedAsync; if (TrackSelectedLogic.IsTrackSelected) { await DefaultLoadAsync(); } }
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); } }
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); } }
public RiskPasswordService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic) : base(httpClientFactory, routeBindingLogic, trackSelectedLogic) { }
public BaseService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic, bool secureService = true) { httpClient = httpClientFactory.CreateClient(secureService ? HttpClientSecureLogicalName : HttpClientLogicalName); this.routeBindingLogic = routeBindingLogic; this.trackSelectedLogic = trackSelectedLogic; }
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}"); }
public ClientService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic) : base(httpClientFactory, routeBindingLogic, trackSelectedLogic, false) { }
public DownPartyService(IHttpClientFactory httpClientFactory, RouteBindingLogic routeBindingLogic, TrackSelectedLogic trackSelectedLogic) : base(httpClientFactory, routeBindingLogic, trackSelectedLogic) { }
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; }