Пример #1
0
        public async Task AddClientAsync()
        {
            string              a       = "secret".Sha512();
            IClientService      service = Startup.CreateCluster().GrainFactory.GetGrain <IClientService>("@");
            ClientAddRequestDto dto     = new ClientAddRequestDto
            {
                ClientName  = "OTC客户端",
                ClientUri   = "https://otc1.zgzop.com",
                MerchantId  = "10000",
                Description = "OTC客户端",
                LoginUri    = "https://otc1.zgzop.com/login"
            };

            dto.AllowedGrantTypes.Add(GrantType.ClientCredentials);
            dto.AllowedScopes.Add("profile");
            dto.AllowedScopes.Add("phone");
            dto.AllowedScopes.Add("openid");
            dto.AllowedScopes.Add("UC_API");
            dto.AllowedScopes.Add("OTC_API");
            dto.AllowedScopes.Add("OT_API");
            var secret = new DTO.SecretDto("Gcyayx5tX2x12Vhp07BJuoAqXG8P4mUY", "OTC客户端-Gcyayx5tX2x12Vhp07BJuoAqXG8P4mUY", Convert.ToDateTime("2030-01-01 12:12:12"));

            dto.Secrets.Add(secret);
            var response = await service.AddAsync(dto);
        }
Пример #2
0
        public async Task AddApiResource()
        {
            string d = "944d6r8wQsImSaty53p12JQ4VdmpMO0r".Sha512();
            IApiResourceService service = Startup.CreateCluster().GrainFactory.GetGrain <IApiResourceService>(0);
            var request = new DTO.ApiResourceAddRequestDto()
            {
                Description = "COTC_API",
                DisplayName = "COTC服务",
                Name        = "COTC_API"
            };
            var secret = new DTO.SecretDto("d7sUJjDOwN5QgqqWIhQoXKMqQR13HKpL", "基金服务-d7sUJjDOwN5QgqqWIhQoXKMqQR13HKpL", Convert.ToDateTime("2030-01-01 12:12:12"));

            request.Secrets.Add(secret);
            var r = await service.AddAsync(request);
        }