Пример #1
0
        public static ClientInfo CreateFromJson(string clientInfo)
        {
            if (string.IsNullOrEmpty(clientInfo))
            {
                throw new ArgumentNullException(nameof(clientInfo), $"client info returned from the server is null");
            }

            return(DeserializeFromJson <ClientInfo>(Base64UrlHelpers.DecodeToBytes(clientInfo)));
        }
        public static ClientInfo?CreateFromJson(string clientInfo)
        {
            if (string.IsNullOrEmpty(clientInfo))
            {
                throw new ArgumentNullException(nameof(clientInfo), IDWebErrorMessage.ClientInfoReturnedFromServerIsNull);
            }

            return(DeserializeFromJson(Base64UrlHelpers.DecodeToBytes(clientInfo)));
        }
Пример #3
0
        public static ClientInfo CreateFromJson(string clientInfo)
        {
            if (string.IsNullOrEmpty(clientInfo))
            {
                throw new ArgumentNullException(nameof(clientInfo), $"client info returned from the server is null");
            }

            try
            {
                return(DeserializeFromJson <ClientInfo>(Base64UrlHelpers.DecodeToBytes(clientInfo)));
            }
            catch (Exception exc)
            {
                throw new ArgumentException($"Failed to parse the returned client info. ", nameof(clientInfo));
            }
        }