modules/jooby-pac4j/src/main/java/org/jooby/pac4j/Auth.java
public Auth basic(final String pattern,
      final Class<? extends Authenticator<UsernamePasswordCredentials>> authenticator) {
    bindings.put(pattern, (binder, config) -> {
      TypeLiteral<Authenticator<UsernamePasswordCredentials>> usernamePasswordAuthenticator = new TypeLiteral<Authenticator<UsernamePasswordCredentials>>() {
      };
      binder.bind(usernamePasswordAuthenticator.getRawType()).to(authenticator);

      bindProfile(binder, CommonProfile.class);

      Multibinder.newSetBinder(binder, Client.class)
          .addBinding().toProvider(BasicAuth.class);

      return new AuthFilter(IndirectBasicAuthClient.class, CommonProfile.class);
    });
    return this;
  }
public Auth basic(final String pattern,
      final Class<? extends Authenticator<UsernamePasswordCredentials>> authenticator) {
    bindings.put(pattern, (binder, config) -> {
      TypeLiteral<Authenticator<UsernamePasswordCredentials>> usernamePasswordAuthenticator = new TypeLiteral<Authenticator<UsernamePasswordCredentials>>() {
      };
      binder.bind(usernamePasswordAuthenticator.getRawType()).to(authenticator);

      bindProfile(binder, CommonProfile.class);

      Multibinder.newSetBinder(binder, Client.class)
          .addBinding().toProvider(BasicAuth.class);

      return new AuthFilter(IndirectBasicAuthClient.class, CommonProfile.class);
    });
    return this;
  }
Add a basic auth client.

@param pattern URL pattern to protect.
@param authenticator Authenticator to use.
@return This module.