protected override async Task <List <Secret> > DeserializeApiSecretsAsync(string obj)
        {
            obj = string.IsNullOrEmpty(obj) ? "[]" : obj;
            var simpleDocument = new SimpleJsonJsonDocument <List <Secret> >(obj);
            var document       = (List <Secret>)simpleDocument.Document;

            return(document);
        }
        public override async Task <List <Secret> > DeserializeSecretsAsync(string obj)
        {
            obj = string.IsNullOrEmpty(obj) ? "[]" : obj;
            var simpleDocument = new SimpleJsonJsonDocument <List <Secret> >(obj);
            var document       = (List <Secret>)simpleDocument.Document;

            return(await Task.FromResult(document));
        }
        public override async Task <IDictionary <string, string> > DeserializeStringDictionaryAsync(string obj)
        {
            obj = string.IsNullOrEmpty(obj) ? "{}" : obj;
            var simpleDocument = new SimpleJsonJsonDocument <Dictionary <string, string> >(obj);
            var document       = (Dictionary <string, string>)simpleDocument.Document;

            return(await Task.FromResult(document));
        }
Example #4
0
        public override List <string> DeserializeScopes(string obj)
        {
            obj = string.IsNullOrEmpty(obj) ? "[]" : obj;
            var simpleDocument = new SimpleJsonJsonDocument <List <string> >(obj);
            var document       = (List <string>)simpleDocument.Document;

            return(document);
        }
        protected override async Task <List <IdentityResourceModel> > DeserializeIdentityResourcesAsync(string obj)
        {
            obj = string.IsNullOrEmpty(obj) ? "[]" : obj;
            var simpleDocument = new SimpleJsonJsonDocument <List <IdentityResourceModel> >(obj);
            var document       = (List <IdentityResourceModel>)simpleDocument.Document;

            return(document);
        }
        public override async Task <List <Claim> > DeserializeClaimsAsync(string obj)
        {
            obj = string.IsNullOrEmpty(obj) ? "[]" : obj;
            var simpleDocument = new SimpleJsonJsonDocument <List <ClaimModel> >(obj);
            var document       = (List <ClaimModel>)simpleDocument.Document;
            var result         = document.ToClaims();

            return(await Task.FromResult(result));
        }
        public override string Serialize(ICollection <Secret> apiSecrets)
        {
            if (apiSecrets == null)
            {
                return("[]");
            }
            var simpleDocument = new SimpleJsonJsonDocument <List <Secret> >(apiSecrets.ToList()).DocumentJson;

            return(simpleDocument);
        }
        internal override string Serialize(ICollection <Scope> scopes)
        {
            if (scopes == null)
            {
                return("[]");
            }
            var simpleDocument = new SimpleJsonJsonDocument <List <Scope> >(scopes.ToList()).DocumentJson;

            return(simpleDocument);
        }
        internal override string Serialize(ICollection <string> userClaims)
        {
            if (userClaims == null)
            {
                return("[]");
            }
            var simpleDocument = new SimpleJsonJsonDocument <List <string> >(userClaims.ToList()).DocumentJson;

            return(simpleDocument);
        }
        public override string Serialize(List <Secret> secrets)
        {
            if (secrets == null)
            {
                return("[]");
            }
            var simpleDocument = new SimpleJsonJsonDocument <List <Secret> >(secrets).DocumentJson;

            return(simpleDocument);
        }
        public override string Serialize(List <string> stringList)
        {
            if (stringList == null)
            {
                return("[]");
            }
            var simpleDocument = new SimpleJsonJsonDocument <List <string> >(stringList).DocumentJson;

            return(simpleDocument);
        }
        public override string Serialize(Dictionary <string, string> dict)
        {
            if (dict == null)
            {
                return("{}");
            }
            var simpleDocument = new SimpleJsonJsonDocument <Dictionary <string, string> >(dict).DocumentJson;

            return(simpleDocument);
        }
        public override string Serialize(ICollection <ApiResourceModel> apiResources)
        {
            if (apiResources == null)
            {
                return("[]");
            }
            var simpleDocument = new SimpleJsonJsonDocument <List <ApiResourceModel> >(apiResources.ToList()).DocumentJson;

            return(simpleDocument);
        }
        public override string Serialize(List <Claim> claims)
        {
            var normalized = claims == null ? null : claims.ToClaimTypeRecords();

            if (normalized == null)
            {
                return("[]");
            }
            var simpleDocument = new SimpleJsonJsonDocument <List <ClaimModel> >(normalized).DocumentJson;

            return(simpleDocument);
        }