Interface Application


public interface Application
Handles authentication with the backend system.
Author:
Samuel Padgett
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the name of the application to show in the login dialog.
    getRealm(jakarta.servlet.http.HttpServletRequest request)
    Gets the realm to be included in OAuth problem responses.
    boolean
    isAdminSession(jakarta.servlet.http.HttpServletRequest request)
    Determines if the current session is an admin session.
    boolean
    isAuthenticated(jakarta.servlet.http.HttpServletRequest request)
    Determines if the user is already authenticated with the application.
    void
    login(jakarta.servlet.http.HttpServletRequest request, String id, String password)
    Authenticates with the application.
  • Method Details

    • getName

      String getName()
      Gets the name of the application to show in the login dialog.
      Returns:
      the application name
    • login

      void login(jakarta.servlet.http.HttpServletRequest request, String id, String password) throws AuthenticationException
      Authenticates with the application. On errors, throws an AuthenticationException.
      Parameters:
      request - the servlet request
      id - the user's ID
      password - the user's password
      Throws:
      AuthenticationException - if authentication fails
    • isAuthenticated

      boolean isAuthenticated(jakarta.servlet.http.HttpServletRequest request)
      Determines if the user is already authenticated with the application. If so, the OAuth provider can show a different authorization dialog that doesn't require a login.
      Parameters:
      request - the servlet request
      Returns:
      if the user is already logged in for this session
    • isAdminSession

      boolean isAdminSession(jakarta.servlet.http.HttpServletRequest request)
      Determines if the current session is an admin session. If so, the user will be able to approve, edit, and delete OAuth consumers.
      Parameters:
      request - the HTTP request
      Returns:
      if this is an admin session
    • getRealm

      String getRealm(jakarta.servlet.http.HttpServletRequest request)
      Gets the realm to be included in OAuth problem responses.
      Parameters:
      request - the HTTP request
      Returns:
      the realm