code: @Override
    public String issueSAD(ProfileRequestContext<?, ?> context, List<Attribute> attributes, String subjectAttributeName, String loa)
        throws ExternalAutenticationErrorCodeException {
  
      SignatureActivationDataContext sadContext = this.getSadContext(context);
      if (sadContext == null) {
        log.error("No SignatureActivationDataContext available [{}]", this.getLogString(context));
        throw new ExternalAutenticationErrorCodeException(AuthnEventIds.INVALID_AUTHN_CTX, "Missing SignatureActivationDataContext");
      }
  
      Attribute subjectAttribute = attributes.stream()
        .filter(a -> a.getName().equals(subjectAttributeName))
        .findFirst()
        .orElse(null);
      if (subjectAttribute == null) {
        log.error("No {} attribute available", subjectAttributeName);
        throw new ExternalAutenticationErrorCodeException(AuthnEventIds.INVALID_AUTHN_CTX, "No principal attribute available");
      }
  
      final SADRequest sadRequest = sadContext.getSadRequest();
      final SADVersion version = sadRequest.getRequestedVersion() != null ? sadRequest.getRequestedVersion() : SADVersion.VERSION_10;
  
      SAD sad = this.sadFactory.getBuilder()
        .subject(AttributeUtils.getAttributeStringValue(subjectAttribute))
        .audience(sadRequest.getRequesterID())
        .version(version)
        .inResponseTo(sadRequest.getID())
        .loa(loa)
        .requestID(sadRequest.getSignRequestID())
        .numberOfDocuments(sadRequest.getDocCount())
        .buildSAD();
  
      sad.getSeElnSadext().setAttributeName(subjectAttributeName);
  
      log.debug("Issuing SAD: {} []", sad, this.getLogString(context));
  
      // Sign the SAD and return it ...
      //
      try {
        return this.signatureSupportKeyService.createSADJwt(sad);
      }
      catch (SignatureException | IOException e) {
        log.error("Failed to sign SAD JWT", e);
        // TODO: Change error code
        throw new ExternalAutenticationErrorCodeException(AuthnEventIds.INVALID_AUTHN_CTX, "Failed to create JWT");
      }
    }
docs: {@inheritDoc}