Class AuthenticationFilter

java.lang.Object
io.antmedia.filter.AbstractFilter
io.antmedia.console.rest.AuthenticationFilter
All Implemented Interfaces:
jakarta.servlet.Filter

public class AuthenticationFilter extends AbstractFilter
  • Field Details

  • Constructor Details

    • AuthenticationFilter

      public AuthenticationFilter()
  • Method Details

    • getAbstractConsoleDataStore

      public AbstractConsoleDataStore getAbstractConsoleDataStore()
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Check authentication and authorization There are 3 types of user ADMIN can do anything in its scope. If it's scope is system, it can CRUD anything If it's scope is an application, it can CRUD anything in the application. it cannot access the web panel services READ_ONLY can read anything in its scope. If it's scope is system, it can READ anything If it's scope is an application, it can only READ anything in the application it cannot access the web panel services USER can do anything but cannot change the settings in its scope. If it's scope is system, it can CRUD content but cannot change system settings If it's scope is an application, it can CRUD content but cannot change system settings/server settings, cannot add/remove users or applications Scope: - System - Specific Application
      Throws:
      IOException
      jakarta.servlet.ServletException
    • isRequestingOneOfAppSettingsOfUsersApps

      private boolean isRequestingOneOfAppSettingsOfUsersApps(Map appNameUserType, String userScope, String path)
    • scopeAccessGranted

      private boolean scopeAccessGranted(String userScope, String dispatchUrl)
    • checkScopeAccessForAppName

      private boolean checkScopeAccessForAppName(Map appNameUserType, String dispatchUrl)
    • checkJWT

      private boolean checkJWT(String jwtString)