Class NoAuthStrategy

  • All Implemented Interfaces:
    AuthStrategy

    public class NoAuthStrategy
    extends Object
    implements AuthStrategy
    Authentication strategy that performs no authentication.

    This is the default strategy used when no authentication is configured. It does not add any authentication headers to requests.

    Usage

    
     // Explicitly create no-auth strategy
     AuthStrategy auth = AuthStrategyFactory.createNoAuth();
    
     // Or simply don't set an auth strategy (default behavior)
     RocketRestConfig config = RocketRestConfig.builder("https://public-api.example.com")
         .build();  // Uses NoAuthStrategy by default
     
    Since:
    1.0.0
    Author:
    guinetik <guinetik@gmail.com>
    See Also:
    AuthStrategy, AuthStrategyFactory.createNoAuth()
    • Constructor Detail

      • NoAuthStrategy

        public NoAuthStrategy()
    • Method Detail

      • applyAuthHeaders

        public RocketHeaders applyAuthHeaders​(RocketHeaders headers)
        Description copied from interface: AuthStrategy
        Applies authentication headers to an existing HttpHeader object.
        Specified by:
        applyAuthHeaders in interface AuthStrategy
        Parameters:
        headers - the current HttpHeader to update
        Returns:
        the updated HttpHeader
      • needsTokenRefresh

        public boolean needsTokenRefresh()
        Description copied from interface: AuthStrategy
        Indicates whether this strategy needs a token refresh.
        Specified by:
        needsTokenRefresh in interface AuthStrategy
        Returns:
        true if token refresh is required
      • refreshCredentials

        public boolean refreshCredentials()
        Description copied from interface: AuthStrategy
        Handles refreshing the authentication credentials for strategies that support it.
        Specified by:
        refreshCredentials in interface AuthStrategy
        Returns:
        true if the credentials were successfully refreshed