code: protected Pair<SamlRegisteredService, SamlRegisteredServiceServiceProviderMetadataFacade> getRegisteredServiceAndFacade(final AuthnRequest request) {
          val issuer = SamlIdPUtils.getIssuerFromSamlObject(request);
          LOGGER.debug("Located issuer [{}] from authentication context", issuer);
  
          val registeredService = verifySamlRegisteredService(issuer);
  
          LOGGER.debug("Located SAML metadata for [{}]", registeredService.getServiceId());
          val adaptor = getSamlMetadataFacadeFor(registeredService, request);
  
          if (adaptor.isEmpty()) {
              throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE,
                  "Cannot find metadata linked to " + issuer);
          }
          val facade = adaptor.get();
          return Pair.of(registeredService, facade);
      }
docs: Gets registered service and facade.
  
  @param request the request
  @return the registered service and facade