private static Auth0Config CreatePersistedObject()
        {
            var persistedObject = new Auth0Config(Auth0PersistedObjectName, SPFarm.Local);
            persistedObject.Update();

            return persistedObject;
        }
Example #2
0
 public void SaveConfiguration(Auth0Config auth0Config)
 {
     if (auth0Config != null)
     {
         auth0Config.Update();
     }
 }
 public void SaveConfiguration(Auth0Config auth0Config)
 {
     if (auth0Config != null)
     {
         auth0Config.Update();
     }
 }
Example #4
0
        private static Auth0Config CreatePersistedObject()
        {
            var persistedObject = new Auth0Config(Auth0PersistedObjectName, SPFarm.Local);

            persistedObject.Update();

            return(persistedObject);
        }
        protected void InitializeAuth0Client()
        {
            this.auth0Config = this.configurationRepository.GetConfiguration();

            if (!this.auth0Config.IsValid)
            {
                return;
            }

            try
            {
                var clientsIds = this.auth0Config.ClientId.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
                var clientsSecrets = this.auth0Config.ClientSecret.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
                var clientIdIndex = Array.IndexOf(clientsIds, Utils.GetClaimsValue(ClientIdClaimsType));

                // if clientID was not found, use the first one configured on central admin
                if (clientIdIndex == -1)
                {
                    clientIdIndex = 0;
                }

                this.auth0Client = new Auth0.Client(
                    clientsIds[clientIdIndex],
                    clientsSecrets[clientIdIndex],
                    this.auth0Config.Domain);
            }
            catch (Exception ex)
            {
                Auth0LoggingService.WriteError(ex.ToString());
            }

            this.alwaysResolveValue = true; //this.auth0Config.AlwaysResolveUserInput;
            this.pickerEntityGroupName = this.auth0Config.PickerEntityGroupName;
        }