public static boolean isRelayStateURLValid(String metaAlias,String relayState,String role){
  boolean result=false;
  if (metaAlias != null) {
    String realm=SAML2MetaUtils.getRealmByMetaAlias(metaAlias);
    try {
      String hostEntityID=saml2MetaManager.getEntityByMetaAlias(metaAlias);
      if (hostEntityID != null) {
        validateRelayStateURL(realm,hostEntityID,relayState,role);
        result=true;
      }
    }
 catch (    SAML2Exception e) {
      if (debug.messageEnabled()) {
        debug.message("SAML2Utils.isRelayStateURLValid(): relayState " + relayState + " for role "+ role+ " triggered an exception: "+ e.getMessage(),e);
      }
      result=false;
    }
  }
  if (debug.messageEnabled()) {
    debug.message("SAML2Utils.isRelayStateURLValid(): relayState " + relayState + " for role "+ role+ " was valid? "+ result);
  }
  return result;
}

public static boolean isRelayStateURLValid ( String metaAlias , String relayState , String role ) { boolean result = false ; if ( metaAlias != null ) { String realm = SAML2MetaUtils . getRealmByMetaAlias ( metaAlias ) ; try { String hostEntityID = saml2MetaManager . getEntityByMetaAlias ( metaAlias ) ; if ( hostEntityID != null ) { validateRelayStateURL ( realm , hostEntityID , relayState , role ) ; result = true ; } } catch ( SAML2Exception e ) { if ( debug . messageEnabled ( ) ) { debug . message ( "SAML2Utils.isRelayStateURLValid(): relayState " + relayState + " for role " + role + " triggered an exception: " + e . getMessage ( ) , e ) ; } result = false ; } } if ( debug . messageEnabled ( ) ) { debug . message ( "SAML2Utils.isRelayStateURLValid(): relayState " + relayState + " for role " + role + " was valid? " + result ) ; } return result ; }
convenience method to validate a saml2 relay state ( goto ) url , often called from a jsp .
