Package org.apereo.cas.impl.calcs
Class BaseAuthenticationRequestRiskCalculator
- java.lang.Object
-
- org.apereo.cas.impl.calcs.BaseAuthenticationRequestRiskCalculator
-
- All Implemented Interfaces:
AuthenticationRequestRiskCalculator
- Direct Known Subclasses:
DateTimeAuthenticationRequestRiskCalculator,GeoLocationAuthenticationRequestRiskCalculator,IpAddressAuthenticationRequestRiskCalculator,UserAgentAuthenticationRequestRiskCalculator
public abstract class BaseAuthenticationRequestRiskCalculator extends java.lang.Object implements AuthenticationRequestRiskCalculator
- Since:
- 5.1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apereo.cas.support.events.CasEventRepositorycasEventRepositoryCAS event repository instance.protected org.apereo.cas.configuration.CasConfigurationPropertiescasPropertiesCAS settings.-
Fields inherited from interface org.apereo.cas.api.AuthenticationRequestRiskCalculator
HIGHEST_RISK_SCORE, LOWEST_RISK_SCORE
-
-
Constructor Summary
Constructors Constructor Description BaseAuthenticationRequestRiskCalculator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticationRiskScorecalculate(org.apereo.cas.authentication.Authentication authentication, org.apereo.cas.services.RegisteredService service, javax.servlet.http.HttpServletRequest request)Calculate authentication risk score.protected java.math.BigDecimalcalculateScore(javax.servlet.http.HttpServletRequest request, org.apereo.cas.authentication.Authentication authentication, org.apereo.cas.services.RegisteredService service, java.util.Collection<? extends org.apereo.cas.support.events.dao.CasEvent> events)Calculate score authentication risk score.protected java.math.BigDecimalcalculateScoreBasedOnEventsCount(org.apereo.cas.authentication.Authentication authentication, java.util.Collection<? extends org.apereo.cas.support.events.dao.CasEvent> events, long count)Calculate score based on events count big decimal.protected java.util.Collection<? extends org.apereo.cas.support.events.dao.CasEvent>getCasTicketGrantingTicketCreatedEventsFor(java.lang.String principal)Gets cas ticket granting ticket created events.protected java.math.BigDecimalgetFinalAveragedScore(long eventCount, long total)Gets final averaged score.
-
-
-
Method Detail
-
calculate
public final AuthenticationRiskScore calculate(org.apereo.cas.authentication.Authentication authentication, org.apereo.cas.services.RegisteredService service, javax.servlet.http.HttpServletRequest request)
Description copied from interface:AuthenticationRequestRiskCalculatorCalculate authentication risk score.- Specified by:
calculatein interfaceAuthenticationRequestRiskCalculator- Parameters:
authentication- the authenticationservice- the servicerequest- the request- Returns:
- the authentication risk score
-
calculateScore
protected java.math.BigDecimal calculateScore(javax.servlet.http.HttpServletRequest request, org.apereo.cas.authentication.Authentication authentication, org.apereo.cas.services.RegisteredService service, java.util.Collection<? extends org.apereo.cas.support.events.dao.CasEvent> events)Calculate score authentication risk score.- Parameters:
request- the requestauthentication- the authenticationservice- the serviceevents- the events- Returns:
- the authentication risk score
-
getCasTicketGrantingTicketCreatedEventsFor
protected java.util.Collection<? extends org.apereo.cas.support.events.dao.CasEvent> getCasTicketGrantingTicketCreatedEventsFor(java.lang.String principal)
Gets cas ticket granting ticket created events.- Parameters:
principal- the principal- Returns:
- the cas ticket granting ticket created events for
-
calculateScoreBasedOnEventsCount
protected java.math.BigDecimal calculateScoreBasedOnEventsCount(org.apereo.cas.authentication.Authentication authentication, java.util.Collection<? extends org.apereo.cas.support.events.dao.CasEvent> events, long count)Calculate score based on events count big decimal.- Parameters:
authentication- the authenticationevents- the eventscount- the count- Returns:
- the big decimal
-
getFinalAveragedScore
protected java.math.BigDecimal getFinalAveragedScore(long eventCount, long total)Gets final averaged score.- Parameters:
eventCount- the event counttotal- the total- Returns:
- the final averaged score
-
-