示例#1
0
        public async Task <IActionResult> Put(
            Guid id,
            GoogleAuthenticationServiceResource resource)
        {
            ChangeGoogleAdto changeGoogleAdto = new ChangeGoogleAdto
            {
                Id                        = id,
                Name                      = resource.Name,
                ClientId                  = resource.ClientId,
                ClientSecret              = resource.ClientSecret,
                GrantAccessTokenUrl       = resource.GrantAccessTokenUrl,
                ValidateAccessTokenUrl    = resource.ValidateAccessTokenUrl,
                ClientGrantAccessTokenUrl = resource.ClientGrantAccessTokenUrl,
                Version                   = resource.Version
            };

            GoogleAdto googleAdto = await
                                    _googleAuthenticationServiceApplicationService.ChangeAsync(changeGoogleAdto);

            return(Ok(_resourceBuilder.Build(_mapper.Map <GoogleAdto, GoogleAuthenticationServiceResource>(googleAdto))));
        }
示例#2
0
 public Task <GoogleAdto> ChangeAsync(ChangeGoogleAdto changeGoogleAdto)
 {
     return(_securityApplicationService.SecureAsync(() => _googleAuthenticationServiceApplicationService.ChangeAsync(changeGoogleAdto),
                                                    DefaultAuthorisationContext.Create(AuthorisationResource.AuthenticationService, AuthorisationAction.Update)));
 }