Class RegisteredServiceAccessStrategyUtils


  • public class RegisteredServiceAccessStrategyUtils
    extends java.lang.Object
    This is RegisteredServiceAccessStrategyUtils that encapsulates common operations relevant to registered service access strategy and authorizations. This is a support utility class that acts as a façade around common authorization and access strategy presented in CAS.
    Since:
    5.0.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void ensureServiceAccessIsAllowed​(java.lang.String service, org.apereo.cas.services.RegisteredService registeredService)
      Ensure service access is allowed.
      static void ensureServiceAccessIsAllowed​(org.apereo.cas.authentication.principal.Service service, org.apereo.cas.services.RegisteredService registeredService)
      Ensure service access is allowed.
      static void ensureServiceAccessIsAllowed​(org.apereo.cas.services.RegisteredService registeredService)
      Ensure service access is allowed.
      static boolean ensureServiceIsNotExpired​(org.apereo.cas.services.RegisteredService registeredService)
      Ensure service is not expired.
      static void ensureServiceSsoAccessIsAllowed​(org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.ticket.TicketGrantingTicket ticketGrantingTicket)
      Ensure service sso access is allowed.
      static void ensureServiceSsoAccessIsAllowed​(org.apereo.cas.services.RegisteredService registeredService, org.apereo.cas.authentication.principal.Service service, org.apereo.cas.ticket.TicketGrantingTicket ticketGrantingTicket, boolean credentialsProvided)
      Ensure service sso access is allowed.
      protected static java.time.LocalDateTime getCurrentSystemTime()
      Gets current system time.
      static java.util.function.Predicate<org.apereo.cas.services.RegisteredService> getRegisteredServiceExpirationPolicyPredicate()
      Returns a predicate that determined whether a service has expired.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RegisteredServiceAccessStrategyUtils

        public RegisteredServiceAccessStrategyUtils()
    • Method Detail

      • ensureServiceAccessIsAllowed

        public static void ensureServiceAccessIsAllowed​(org.apereo.cas.services.RegisteredService registeredService)
        Ensure service access is allowed.
        Parameters:
        registeredService - the registered service
      • ensureServiceAccessIsAllowed

        public static void ensureServiceAccessIsAllowed​(java.lang.String service,
                                                        org.apereo.cas.services.RegisteredService registeredService)
        Ensure service access is allowed.
        Parameters:
        service - the service
        registeredService - the registered service
      • ensureServiceAccessIsAllowed

        public static void ensureServiceAccessIsAllowed​(org.apereo.cas.authentication.principal.Service service,
                                                        org.apereo.cas.services.RegisteredService registeredService)
        Ensure service access is allowed.
        Parameters:
        service - the service
        registeredService - the registered service
      • ensureServiceIsNotExpired

        public static boolean ensureServiceIsNotExpired​(org.apereo.cas.services.RegisteredService registeredService)
        Ensure service is not expired.
        Parameters:
        registeredService - the service
        Returns:
        boolean - true if service is not expired
      • ensureServiceSsoAccessIsAllowed

        public static void ensureServiceSsoAccessIsAllowed​(org.apereo.cas.services.RegisteredService registeredService,
                                                           org.apereo.cas.authentication.principal.Service service,
                                                           org.apereo.cas.ticket.TicketGrantingTicket ticketGrantingTicket)
        Ensure service sso access is allowed.
        Parameters:
        registeredService - the registered service
        service - the service
        ticketGrantingTicket - the ticket granting ticket
      • ensureServiceSsoAccessIsAllowed

        public static void ensureServiceSsoAccessIsAllowed​(org.apereo.cas.services.RegisteredService registeredService,
                                                           org.apereo.cas.authentication.principal.Service service,
                                                           org.apereo.cas.ticket.TicketGrantingTicket ticketGrantingTicket,
                                                           boolean credentialsProvided)
        Ensure service sso access is allowed.
        Parameters:
        registeredService - the registered service
        service - the service
        ticketGrantingTicket - the ticket granting ticket
        credentialsProvided - the credentials provided
      • getRegisteredServiceExpirationPolicyPredicate

        public static java.util.function.Predicate<org.apereo.cas.services.RegisteredService> getRegisteredServiceExpirationPolicyPredicate()
        Returns a predicate that determined whether a service has expired.
        Returns:
        true if the service is still valid. false if service has expired.
      • getCurrentSystemTime

        protected static java.time.LocalDateTime getCurrentSystemTime()
        Gets current system time.
        Returns:
        the current system time