Exemplo n.º 1
0
        public OidcSettingsValidationResult Validate(OidcSettings settings)
        {
            var result = new OidcSettingsValidationResult();

            if (settings == null)
            {
                result.AddError("Missing Oidc settings");
                return(result);
            }

            if (settings.Issuer == null)
            {
                result.AddError("Missing issuer");
            }
            if (settings.ClientId.IsEmpty())
            {
                result.AddError("Missing client id");
            }
            if (settings.ResponseType.IsEmpty())
            {
                result.AddError("Missing response type");
            }
            if (settings.Scope.IsEmpty())
            {
                result.AddError("Missing scope");
            }
            if (settings.StoragePrefix.IsEmpty())
            {
                result.AddError("Missing storage prefix");
            }

            return(result);
        }
        public OidcSettingsValidationResult Validate(OidcSettings settings)
        {
            var result = new OidcSettingsValidationResult();

            if (settings == null)
            {
                result.AddError("Missing Oidc settings");
                return(result);
            }

            if (settings.Issuer == null)
            {
                result.AddError("Missing issuer");
            }
            if (settings.ClientId.IsEmpty())
            {
                result.AddError("Missing client id");
            }
            if (settings.ResponseType.IsEmpty())
            {
                result.AddError("Missing response type");
            }
            if (settings.Scope.IsEmpty())
            {
                result.AddError("Missing scope");
            }

            if (settings.StorageType.IsMemory() && settings.InteractionType.IsRedirect())
            {
                result.AddError("Interaction type cannot be redirect using memory storage");
            }

            if (!settings.StorageType.IsMemory() && settings.StoragePrefix.IsEmpty())
            {
                result.AddError("Missing storage prefix");
            }

            return(result);
        }