/** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " PasswordPolicyResponse control :\n" ); sb.append( " oid : '" ).append( getOid() ).append( '\n' ); if ( hasResponse() && getResponse().getTimeBeforeExpiration() >= 0 ) { sb.append( " timeBeforeExpiration : '" ).append( getResponse().getTimeBeforeExpiration() ) .append( '\n' ); } else if ( hasResponse() && getResponse().getGraceAuthNRemaining() >= 0 ) { sb.append( " graceAuthNsRemaining : '" ).append( getResponse().getGraceAuthNRemaining() ) .append( '\n' ); } if ( hasResponse() && getResponse().getPasswordPolicyError() != null ) { sb.append( " ppolicyError : '" ).append( getResponse().getPasswordPolicyError().toString() ) .append( '\n' ); } return sb.toString(); }
/** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " PasswordPolicyResponse control :\n" ); sb.append( " oid : '" ).append( getOid() ).append( '\n' ); if ( hasResponse() && getResponse().getTimeBeforeExpiration() >= 0 ) { sb.append( " timeBeforeExpiration : '" ).append( getResponse().getTimeBeforeExpiration() ) .append( '\n' ); } else if ( hasResponse() && getResponse().getGraceAuthNRemaining() >= 0 ) { sb.append( " graceAuthNsRemaining : '" ).append( getResponse().getGraceAuthNRemaining() ) .append( '\n' ); } if ( hasResponse() && getResponse().getPasswordPolicyError() != null ) { sb.append( " ppolicyError : '" ).append( getResponse().getPasswordPolicyError().toString() ) .append( '\n' ); } return sb.toString(); }
/** * {@inheritDoc} */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append( " PasswordPolicyResponse control :\n" ); sb.append( " oid : '" ).append( getOid() ).append( '\n' ); if ( hasResponse() && getResponse().getTimeBeforeExpiration() >= 0 ) { sb.append( " timeBeforeExpiration : '" ).append( getResponse().getTimeBeforeExpiration() ) .append( '\n' ); } else if ( hasResponse() && getResponse().getGraceAuthNRemaining() >= 0 ) { sb.append( " graceAuthNsRemaining : '" ).append( getResponse().getGraceAuthNRemaining() ) .append( '\n' ); } if ( hasResponse() && getResponse().getPasswordPolicyError() != null ) { sb.append( " ppolicyError : '" ).append( getResponse().getPasswordPolicyError().toString() ) .append( '\n' ); } return sb.toString(); }
static PasswordWarning newWarning( PasswordPolicy policy ) { PasswordPolicyResponse response = policy.getResponse(); if ( response != null ) { PasswordWarningImpl policyWarning = new PasswordWarningImpl(); policyWarning.timeBeforeExpiration = response.getTimeBeforeExpiration(); policyWarning.graceAuthNsRemaining = response.getGraceAuthNRemaining(); policyWarning.changeAfterReset = response.getPasswordPolicyError() == PasswordPolicyErrorEnum.CHANGE_AFTER_RESET; if ( policyWarning.timeBeforeExpiration >= 0 || policyWarning.graceAuthNsRemaining >= 0 || policyWarning.changeAfterReset ) { // it actually is a warning! return policyWarning; } } return null; }
static PasswordWarning newWarning( PasswordPolicy policy ) { PasswordPolicyResponse response = policy.getResponse(); if ( response != null ) { PasswordWarningImpl policyWarning = new PasswordWarningImpl(); policyWarning.timeBeforeExpiration = response.getTimeBeforeExpiration(); policyWarning.graceAuthNsRemaining = response.getGraceAuthNRemaining(); policyWarning.changeAfterReset = response.getPasswordPolicyError() == PasswordPolicyErrorEnum.CHANGE_AFTER_RESET; if ( policyWarning.timeBeforeExpiration >= 0 || policyWarning.graceAuthNsRemaining >= 0 || policyWarning.changeAfterReset ) { // it actually is a warning! return policyWarning; } } return null; }
static PasswordWarning newWarning( PasswordPolicy policy ) { PasswordPolicyResponse response = policy.getResponse(); if ( response != null ) { PasswordWarningImpl policyWarning = new PasswordWarningImpl(); policyWarning.timeBeforeExpiration = response.getTimeBeforeExpiration(); policyWarning.graceAuthNsRemaining = response.getGraceAuthNRemaining(); policyWarning.changeAfterReset = response.getPasswordPolicyError() == PasswordPolicyErrorEnum.CHANGE_AFTER_RESET; if ( policyWarning.timeBeforeExpiration >= 0 || policyWarning.graceAuthNsRemaining >= 0 || policyWarning.changeAfterReset ) { // it actually is a warning! return policyWarning; } } return null; }
buffer.put( TLV.getBytes( ppolicySeqLength ) ); if ( ( getResponse().getTimeBeforeExpiration() < 0 ) && ( getResponse().getGraceAuthNRemaining() < 0 ) && ( getResponse().getPasswordPolicyError() == null ) ) getResponse().getTimeBeforeExpiration() ); else if ( getResponse().getGraceAuthNRemaining() >= 0 ) getResponse().getGraceAuthNRemaining() );
buffer.put( TLV.getBytes( ppolicySeqLength ) ); if ( ( getResponse().getTimeBeforeExpiration() < 0 ) && ( getResponse().getGraceAuthNRemaining() < 0 ) && ( getResponse().getPasswordPolicyError() == null ) ) getResponse().getTimeBeforeExpiration() ); else if ( getResponse().getGraceAuthNRemaining() >= 0 ) getResponse().getGraceAuthNRemaining() );
buffer.put( TLV.getBytes( ppolicySeqLength ) ); if ( ( getResponse().getTimeBeforeExpiration() < 0 ) && ( getResponse().getGraceAuthNRemaining() < 0 ) && ( getResponse().getPasswordPolicyError() == null ) ) getResponse().getTimeBeforeExpiration() ); else if ( getResponse().getGraceAuthNRemaining() >= 0 ) getResponse().getGraceAuthNRemaining() );
warningLength = 1 + TLV.getNbBytes( timeBeforeExpirationValueLength ) + timeBeforeExpirationValueLength; else if ( getResponse().getGraceAuthNRemaining() >= 0 ) int graceAuthNsRemainingValueLength = BerValue.getNbBytes( getResponse().getGraceAuthNRemaining() ); warningLength = 1 + TLV.getNbBytes( graceAuthNsRemainingValueLength ) + graceAuthNsRemainingValueLength;
warningLength = 1 + TLV.getNbBytes( timeBeforeExpirationValueLength ) + timeBeforeExpirationValueLength; else if ( getResponse().getGraceAuthNRemaining() >= 0 ) int graceAuthNsRemainingValueLength = BerValue.getNbBytes( getResponse().getGraceAuthNRemaining() ); warningLength = 1 + TLV.getNbBytes( graceAuthNsRemainingValueLength ) + graceAuthNsRemainingValueLength;
warningLength = 1 + TLV.getNbBytes( timeBeforeExpirationValueLength ) + timeBeforeExpirationValueLength; else if ( getResponse().getGraceAuthNRemaining() >= 0 ) int graceAuthNsRemainingValueLength = BerValue.getNbBytes( getResponse().getGraceAuthNRemaining() ); warningLength = 1 + TLV.getNbBytes( graceAuthNsRemainingValueLength ) + graceAuthNsRemainingValueLength;
((PasswordPolicyControl) ctl).setGraceAuthNsRemaining(ppr.getGraceAuthNRemaining());
.PASSWORD_EXPIRATION_WARNING, "PASSWORD WILL EXPIRE", Warning.Type.PASSWORD ) ); if ( respCtrl.getResponse().getGraceAuthNRemaining() > 0 ) pwMsg.setGraceLogins( respCtrl.getResponse().getGraceAuthNRemaining() ); pwMsg.setWarning( new ObjectFactory().createWarning( GlobalPwMsgIds.PASSWORD_GRACE_WARNING, "PASSWORD IN GRACE", Warning.Type.PASSWORD ) );