docs: @Override
      protected void populateLocalEntityId(SAMLMessageContext context, String requestURI) throws MetadataProviderException {
  
          String entityId;
          HTTPInTransport inTransport = (HTTPInTransport) context.getInboundMessageTransport();
  
          // Pre-configured entity Id
          entityId = (String) inTransport.getAttribute(org.springframework.security.saml.SAMLConstants.LOCAL_ENTITY_ID);
          if (entityId != null) {
              log.debug("Using protocol specified IdP {}", entityId);
              context.setLocalEntityId(entityId);
              context.setLocalEntityRole(IDPSSODescriptor.DEFAULT_ELEMENT_NAME);
              return;
          }
  
          if (requestURI == null) {
              requestURI = "";
          }
  
          int filterIndex = requestURI.indexOf("/alias/");
          if (filterIndex != -1) { // EntityId from URL alias
  
              String localAlias = requestURI.substring(filterIndex + 7);
              QName localEntityRole;
  
              int entityTypePosition = localAlias.lastIndexOf('/');
              if (entityTypePosition != -1) {
                  String entityRole = localAlias.substring(entityTypePosition + 1);
                  if ("sp".equalsIgnoreCase(entityRole)) {
                      localEntityRole = SPSSODescriptor.DEFAULT_ELEMENT_NAME;
                  } else {
                      localEntityRole = IDPSSODescriptor.DEFAULT_ELEMENT_NAME;
                  }
                  localAlias = localAlias.substring(0, entityTypePosition);
              } else {
                  localEntityRole = IDPSSODescriptor.DEFAULT_ELEMENT_NAME;
              }
  
  
              // Populate entityId
              entityId = metadata.getEntityIdForAlias(localAlias);
  
              if (entityId == null) {
                  throw new MetadataProviderException("No local entity found for alias " + localAlias + ", verify your configuration.");
              } else {
                  log.debug("Using IdP {} specified in request with alias {}", entityId, localAlias);
              }
  
              context.setLocalEntityId(entityId);
              context.setLocalEntityRole(localEntityRole);
  
          } else { // Defaults
              context.setLocalEntityId(metadata.getDefaultIDP());
              context.setLocalEntityRole(IDPSSODescriptor.DEFAULT_ELEMENT_NAME);
          }
  
      }