public void RefreshExternalIdentityProviders()
        {
            var serverDto  = GetServerDto();
            var tenantName = GetTenantName();
            var auth       = SnapInContext.Instance.AuthTokenManager.GetAuthToken(serverDto, tenantName);

            ActionHelper.Execute(delegate
            {
                IExternalIdentityProviderService externalIdp = _ssoAdminSdkService.ExternalIdentityProvider;
                var externalIdps = externalIdp.GetAll(serverDto, tenantName, auth.Token);
                lstExternalIdentityProviders.Items.Clear();
                if (externalIdps != null)
                {
                    foreach (var idp in externalIdps)
                    {
                        var lvItem = new ListViewItem(new[] { idp.EntityID, idp.Alias, idp.JitEnabled ? "YES" : "NO" })
                        {
                            Tag = idp
                        };
                        lvItem.ImageIndex = (int)TreeImageIndex.IdentityProvider;
                        lstExternalIdentityProviders.Items.Add(lvItem);
                    }
                }
            }, auth);
        }
        private void btnCreateSignerIdentity_Click(object sender, EventArgs e)
        {
            if (ValidateInputs())
            {
                var auth = SnapInContext.Instance.AuthTokenManager.GetAuthToken(_serverDto, _tenantName);
                ActionHelper.Execute(delegate
                {
                    var externalIdentityProviderDto = new ExternalIdentityProviderDto
                    {
                        EntityID            = txtEntityId.Text,
                        Alias               = txtAlias.Text,
                        JitEnabled          = chkJit.Checked,
                        NameIDFormats       = GetNamedIdFormats(),
                        SsoServices         = GetSsoServices(),
                        SloServices         = GetSloServices(),
                        SubjectFormats      = GetSubjectFormats(),
                        SigningCertificates = GetCertificates()
                    };

                    IExternalIdentityProviderService idp = _service.ExternalIdentityProvider;
                    _externalIdentityProviderDtoOrig     = idp.Create(_serverDto, _tenantName, externalIdentityProviderDto, auth.Token);
                }, auth);
                this.DialogResult = DialogResult.OK;
            }
        }
 public ClaimsService(
     IAppConfiguration appConfiguration,
     IExternalIdentityProviderService externalIdentityProviderService)
 {
     _appConfiguration = appConfiguration;
     _externalIdentityProviderService = externalIdentityProviderService;
 }
 public AccountController(
     IIdentityServerInteractionService interaction,
     IClientStore clientStore,
     IHttpContextAccessor httpContextAccessor,
     IEventService events,
     IAppConfiguration appConfiguration,
     IUserStore userStore,
     ILogger logger,
     IExternalIdentityProviderService externalIdentityProviderService,
     IFabricClaimsService claimsService,
     AccountService accountService,
     GroupFilterService groupFilterService,
     TestUserStore users = null)
 {
     // if the TestUserStore is not in DI, then we'll just use the global users collection
     _users            = users ?? MakeTestUserStore(appConfiguration);
     _interaction      = interaction;
     _events           = events;
     _appConfiguration = appConfiguration;
     _logger           = logger;
     _externalIdentityProviderService = externalIdentityProviderService;
     _accountService     = accountService;
     _claimsService      = claimsService;
     _groupFilterService = groupFilterService;
     _userLoginManager   = new UserLoginManager(userStore, _logger);
 }
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (lstExternalIdentityProviders.SelectedIndices.Count == 0)
            {
                return;
            }

            var idp     = (ExternalIdentityProviderDto)lstExternalIdentityProviders.Items[lstExternalIdentityProviders.SelectedIndices[0]].Tag;
            var message = "Delete external identity provider " + idp.EntityID + " ? ";

            if (MMCDlgHelper.ShowConfirm(message))
            {
                var serverDto  = GetServerDto();
                var tenantName = GetTenantName();
                var auth       = SnapInContext.Instance.AuthTokenManager.GetAuthToken(serverDto, tenantName);
                ActionHelper.Execute(delegate
                {
                    IExternalIdentityProviderService externalIdp = _formView.ScopeNode.GetServiceGateway().ExternalIdentityProvider;
                    externalIdp.Delete(serverDto, tenantName, idp, auth.Token);
                    RefreshExternalIdentityProviders();
                }, auth);
            }
        }
Beispiel #6
0
 public PrincipalSeachService(IExternalIdentityProviderService externalIdentityProviderService)
 {
     _externalIdentityProviderService = externalIdentityProviderService;
 }