code: @Override
    public String getReturnAuthnContextClassRef(ProfileRequestContext<?, ?> context, String authnContextUri, boolean displayedSignMessage)
        throws ExternalAutenticationErrorCodeException {
      
      AuthnContextClassContext authnContextContext = this.getAuthnContextClassContext(context);
      
      String uri = null;
      
      if (authnContextUri == null) {
        if (displayedSignMessage) {
          uri = authnContextContext.getAuthnContextClassRefs()
            .stream()
            .filter(u -> this.isSignMessageURI(u))
            .findFirst()
            .orElse(null);
        }
        if (uri == null) {
          uri = !authnContextContext.getAuthnContextClassRefs().isEmpty() ? authnContextContext.getAuthnContextClassRefs().get(0) : null;
        }  
      }
      else {
        if (displayedSignMessage) {
          String sigMessageUri = this.toSignMessageURI(authnContextUri);
          uri = authnContextContext.getAuthnContextClassRefs().contains(sigMessageUri) ? sigMessageUri : null;
        }
        if (uri == null) {
          uri = authnContextContext.getAuthnContextClassRefs().contains(authnContextUri) ? authnContextUri : null;
        }
      }
      
      if (uri == null) {
        // This should never happen!
        final String msg = "No AuthnContext URI:s can be used to authenticate user";
        log.info("{} - can not proceed [{}]", msg, this.getLogString(context));
        throw new ExternalAutenticationErrorCodeException(AuthnEventIds.REQUEST_UNSUPPORTED, msg); 
      }
      
      return uri;
    }
docs: {@inheritDoc}