docs: protected String constructSamlResponse(final GoogleAccountsService service,
                                             final Authentication authentication) {
          val currentDateTime = ZonedDateTime.now(ZoneOffset.UTC);
          val notBeforeIssueInstant = ZonedDateTime.parse("2003-04-17T00:46:02Z");
          val registeredService = servicesManager.findServiceBy(service);
          if (registeredService == null || !registeredService.getAccessStrategy().isServiceAccessAllowed()) {
              throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE);
          }
  
          val principal = authentication.getPrincipal();
          val userId = registeredService.getUsernameAttributeProvider()
              .resolveUsername(principal, service, registeredService);
  
          val response = this.samlObjectBuilder.newResponse(
              this.samlObjectBuilder.generateSecureRandomId(), currentDateTime, null, service);
          response.setStatus(this.samlObjectBuilder.newStatus(StatusCode.SUCCESS, null));
  
          val sessionIndex = '_' + String.valueOf(RandomUtils.nextLong());
          val authnStatement = this.samlObjectBuilder.newAuthnStatement(AuthnContext.PASSWORD_AUTHN_CTX, currentDateTime, sessionIndex);
          val assertion = this.samlObjectBuilder.newAssertion(authnStatement, casServerPrefix,
              notBeforeIssueInstant, this.samlObjectBuilder.generateSecureRandomId());
  
          val conditions = this.samlObjectBuilder.newConditions(notBeforeIssueInstant,
              currentDateTime.plusSeconds(this.skewAllowance), service.getId());
          assertion.setConditions(conditions);
  
          val subject = this.samlObjectBuilder.newSubject(NameID.EMAIL, userId,
              service.getId(), currentDateTime.plusSeconds(this.skewAllowance), service.getRequestId(), null);
          assertion.setSubject(subject);
  
          response.getAssertions().add(assertion);
  
          val result = SamlUtils.transformSamlObject(this.samlObjectBuilder.getOpenSamlConfigBean(), response, true).toString();
          LOGGER.debug("Generated Google SAML response: [{}]", result);
          return result;
      }