public static String findPreferredIDP(String realm,HttpServletRequest request){
  if (request == null) {
    return null;
  }
  String succinctID=request.getParameter(IFSConstants.PROVIDER_ID_KEY);
  if ((succinctID == null) || succinctID.length() == 0) {
    debug.message("FSUtils.findPreferredIDP::Pref IDP not found.");
    return null;
  }
  succinctID=succinctID.trim();
  String preferredSuccinctId=null;
  StringTokenizer st=new StringTokenizer(succinctID," ");
  while (st.hasMoreTokens()) {
    preferredSuccinctId=st.nextToken();
    if ((preferredSuccinctId.length() < 28) && st.hasMoreTokens()) {
      preferredSuccinctId=preferredSuccinctId + "+" + st.nextToken();
    }
  }
  preferredSuccinctId=SAMLUtils.byteArrayToString(Base64.decode(preferredSuccinctId));
  return getProviderIDFromSuccinctID(realm,preferredSuccinctId);
}

public static String findPreferredIDP ( String realm , HttpServletRequest request ) { if ( request == null ) { return null ; } String succinctID = request . getParameter ( IFSConstants . PROVIDER_ID_KEY ) ; if ( ( succinctID == null ) || succinctID . length ( ) == 0 ) { debug . message ( "FSUtils.findPreferredIDP::Pref IDP not found." ) ; return null ; } succinctID = succinctID . trim ( ) ; String preferredSuccinctId = null ; StringTokenizer st = new StringTokenizer ( succinctID , " " ) ; while ( st . hasMoreTokens ( ) ) { preferredSuccinctId = st . nextToken ( ) ; if ( ( preferredSuccinctId . length ( ) < 28 ) && st . hasMoreTokens ( ) ) { preferredSuccinctId = preferredSuccinctId + "+" + st . nextToken ( ) ; } } preferredSuccinctId = SAMLUtils . byteArrayToString ( Base64 . decode ( preferredSuccinctId ) ) ; return getProviderIDFromSuccinctID ( realm , preferredSuccinctId ) ; }
finds the preferred idp from the httpservletrequest .
