class IndirectBasicAuthClient extends IndirectClient {

    private String realmName = Pac4jConstants.DEFAULT_REALM_NAME;

    /**
     * <p>Constructor for IndirectBasicAuthClient.</p>
     */
    public IndirectBasicAuthClient() {}

    /**
     * <p>Constructor for IndirectBasicAuthClient.</p>
     *
     * @param usernamePasswordAuthenticator a {@link Authenticator} object
     */
    public IndirectBasicAuthClient(final Authenticator usernamePasswordAuthenticator) {
        setAuthenticatorIfUndefined(usernamePasswordAuthenticator);
    }

    /**
     * <p>Constructor for IndirectBasicAuthClient.</p>
     *
     * @param realmName a {@link String} object
     * @param usernamePasswordAuthenticator a {@link Authenticator} object
     */
    public IndirectBasicAuthClient(final String realmName, final Authenticator usernamePasswordAuthenticator) {
        this.realmName = realmName;
        setAuthenticatorIfUndefined(usernamePasswordAuthenticator);
    }

    /**
     * <p>Constructor for IndirectBasicAuthClient.</p>
     *
     * @param usernamePasswordAuthenticator a {@link Authenticator} object
     * @param profileCreator a {@link ProfileCreator} object
     */
    public IndirectBasicAuthClient(final Authenticator usernamePasswordAuthenticator, final ProfileCreator profileCreator) {
        setAuthenticatorIfUndefined(usernamePasswordAuthenticator);
        setProfileCreatorIfUndefined(profileCreator);
    }

    /** {@inheritDoc} */
    @Override
    protected void internalInit(final boolean forceReinit) {
        assertNotBlank("realmName", this.realmName);

        setRedirectionActionBuilderIfUndefined(ctx -> {
            val webContext = ctx.webContext();
            return Optional.of(HttpActionHelper.buildRedirectUrlAction(webContext, computeFinalCallbackUrl(webContext)));
        });
        setCredentialsExtractorIfUndefined(new BasicAuthExtractor());
    }

    /** {@inheritDoc} */
    @Override
    public Optional<Credentials> getCredentials(final CallContext ctx) {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override
    protected Optional<Credentials> internalValidateCredentials(final CallContext ctx, final Credentials credentials) {
        assertNotNull("authenticator", getAuthenticator());

        val webContext = ctx.webContext();
        // set the www-authenticate in case of error
        webContext.setResponseHeader(HttpConstants.AUTHENTICATE_HEADER,
            HttpConstants.BASIC_HEADER_PREFIX + "realm=\"" + realmName + "\"");

        try {
            return getAuthenticator().validate(ctx, credentials);
        } catch (final CredentialsException e) {
            throw HttpActionHelper.buildUnauthenticatedAction(webContext);
        }
    }
}

        init();
        assertNotNull("credentialsExtractor", getCredentialsExtractor());

        val webContext = ctx.webContext();
        // set the www-authenticate in case of error
        webContext.setResponseHeader(HttpConstants.AUTHENTICATE_HEADER, HttpConstants.BASIC_HEADER_PREFIX + "realm=\"" + realmName + "\"");

        final Optional<Credentials> credentials;
        try {
            credentials = getCredentialsExtractor().extract(ctx);
            logger.debug("credentials : {}", credentials);

            if (credentials.isEmpty()) {
                throw HttpActionHelper.buildUnauthenticatedAction(webContext);
            }

            return credentials;
        } catch (final CredentialsException e) {
            throw HttpActionHelper.buildUnauthenticatedAction(webContext);
        }
    
<methods>public non-sealed void <init>() ,public java.lang.String computeFinalCallbackUrl(org.pac4j.core.context.WebContext) ,public java.lang.String getCodeVerifierSessionAttributeName() ,public final Optional<org.pac4j.core.exception.http.RedirectionAction> getLogoutAction(CallContext, org.pac4j.core.profile.UserProfile, java.lang.String) ,public java.lang.String getNonceSessionAttributeName() ,public final Optional<org.pac4j.core.exception.http.RedirectionAction> getRedirectionAction(CallContext) ,public java.lang.String getStateSessionAttributeName() ,public org.pac4j.core.exception.http.HttpAction processLogout(CallContext, org.pac4j.core.credentials.Credentials) <variables>public static final java.lang.String ATTEMPTED_AUTHENTICATION_SUFFIX,private static final java.lang.String CODE_VERIFIER_SESSION_PARAMETER,private static final java.lang.String NONCE_SESSION_PARAMETER,private static final java.lang.String STATE_SESSION_PARAMETER,private org.pac4j.core.http.ajax.AjaxRequestResolver ajaxRequestResolver,protected java.lang.String callbackUrl,protected org.pac4j.core.http.callback.CallbackUrlResolver callbackUrlResolver,private boolean checkAuthenticationAttempt,private org.pac4j.core.logout.LogoutActionBuilder logoutActionBuilder,private org.pac4j.core.logout.processor.LogoutProcessor logoutProcessor,private org.pac4j.core.redirect.RedirectionActionBuilder redirectionActionBuilder,protected org.pac4j.core.http.url.UrlResolver urlResolver