Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class HttpBasicConfigurer
- Object
- SecurityConfigurer
- HttpBasicConfigurer
Sign-in with HTTP Basic credentials on each request.
http.httpBasic(basic -> basic.realmName("Orders API"));
On a chain that also declares HttpSecurity.mfa, a user who has a second
factor cannot sign in this way; see secondFactorExempt.
Methods
public HttpBasicConfigurer realmName(String realmName) | The realm named in the challenge; Realm unless set. |
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. |
public HttpBasicConfigurer secondFactorExempt() | Lets a user who has a second factor in with their password alone. |
public void init(HttpSecurity http) | Shares what other parts need to know; nothing by default. |
public void configure(HttpSecurity http) | Adds this part’s filters; nothing by default. |
Inherited methods
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, 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)Shares what other parts need to know; nothing by default.
configure
public void configure(HttpSecurity http)Adds this part’s filters; nothing by default.