Class HttpBasicConfigurer

java.lang.Object
com.codename1.backend.security.SecurityConfigurer
com.codename1.backend.security.HttpBasicConfigurer

public final class HttpBasicConfigurer extends SecurityConfigurer

Sign-in with HTTP Basic credentials on each request.

http.httpBasic(basic -> basic.realmName("Orders API"));

On a chain that also declares HttpSecurity.mfa(Customizer), a user who has a second factor cannot sign in this way; see secondFactorExempt.

  • Method Details

    • realmName

      public HttpBasicConfigurer realmName(String realmName)
      The realm named in the challenge; Realm unless set.
    • authenticationEntryPoint

      public HttpBasicConfigurer authenticationEntryPoint(AuthenticationEntryPoint entryPoint)
      What answers a request whose credentials are refused, and -- when this is the chain's only way in -- one that sent none.
    • secondFactorExempt

      public HttpBasicConfigurer secondFactorExempt()

      Lets a user who has a second factor in with their password alone.

      On a chain with HttpSecurity.mfa(Customizer), Basic credentials of a user who has a second factor are refused: they are a first factor sent with every request, with no step to present a code in, and accepting them would make the code optional for anyone who knows the password. Call this only when that is what is meant -- a chain whose Basic callers are scripts the user set up, on a network that is trusted.

    • init

      public void init(HttpSecurity http)
      Description copied from class: SecurityConfigurer
      Shares what other parts need to know; nothing by default.
      Overrides:
      init in class SecurityConfigurer
    • configure

      public void configure(HttpSecurity http)
      Description copied from class: SecurityConfigurer
      Adds this part's filters; nothing by default.
      Overrides:
      configure in class SecurityConfigurer