Class AuthenticationResolver

java.lang.Object
com.kingsrook.qqq.backend.core.model.metadata.authentication.AuthenticationResolver

public final class AuthenticationResolver extends Object
Utility class for resolving the appropriate authentication provider for a request based on its scope.

The resolver checks scopes in order of specificity:

  1. API-specific scope (if context has API metadata)
  2. Route provider-specific scope (if context has route provider metadata)
  3. Instance default scope (fallback)

If no provider is found, a QException is thrown with appropriate error message.

  • Method Details

    • resolve

      public static QAuthenticationMetaData resolve(QInstance instance, AuthResolutionContext context) throws QException
      Resolve the authentication provider for the given context.

      Checks scopes in order of specificity:

      1. API scope (if apiMetaData is present)
      2. Route provider scope (if routeMetaData is present)
      3. Instance default scope (fallback)

      Parameters:
      instance - The QInstance containing scoped authentication providers
      context - The resolution context with request details
      Returns:
      The resolved authentication metadata (never null)
      Throws:
      QException - If no authentication provider is found