@Override public Session createSession(PrincipalId principal,AuthnMethod authMethod,String externalIDPSessionId,String idpEntId) throws SamlServiceException {
  Validate.notNull(principal,"user principalId");
  Calendar calendar=new GregorianCalendar();
  calendar.add(Calendar.MINUTE,Shared.SESSION_LIFETIME_MINUTES);
  Date sessionEndTime=calendar.getTime();
  try {
    Session currentSession=new Session(principal,sessionEndTime,authMethod);
    if (externalIDPSessionId != null) {
      Validate.notEmpty(idpEntId,"Need idpEntId for creating external authenticated session");
      currentSession.setUsingExtIDP(true);
      currentSession.setExtIDPToUsed(new IDPConfig(idpEntId));
      currentSession.setExtIDPSessionID(externalIDPSessionId);
    }
    add(currentSession);
    return currentSession;
  }
 catch (  NoSuchAlgorithmException e) {
    throw new SamlServiceException(e);
  }
}

@ Override public Session createSession ( PrincipalId principal , AuthnMethod authMethod , String externalIDPSessionId , String idpEntId ) throws SamlServiceException { Validate . notNull ( principal , "user principalId" ) ; Calendar calendar = new GregorianCalendar ( ) ; calendar . add ( Calendar . MINUTE , Shared . SESSION_LIFETIME_MINUTES ) ; Date sessionEndTime = calendar . getTime ( ) ; try { Session currentSession = new Session ( principal , sessionEndTime , authMethod ) ; if ( externalIDPSessionId != null ) { Validate . notEmpty ( idpEntId , "Need idpEntId for creating external authenticated session" ) ; currentSession . setUsingExtIDP ( true ) ; currentSession . setExtIDPToUsed ( new IDPConfig ( idpEntId ) ) ; currentSession . setExtIDPSessionID ( externalIDPSessionId ) ; } add ( currentSession ) ; return currentSession ; } catch ( NoSuchAlgorithmException e ) { throw new SamlServiceException ( e ) ; } }
createsession ( ) create a new session
