yammer / dropwizard-auth-ldap

Dropwizard Authentication Module for LDAP using JNDI.
Apache License 2.0
36 stars 18 forks source link

Example got many errors #15

Closed charbonnier666 closed 7 years ago

charbonnier666 commented 7 years ago

Here detail:

LdapConfiguration ldapConfiguration = configuration.getLdapConfiguration()**[ERROR HERE = create a variable in configuration and alter .yml]**;
Authenticator<BasicCredentials, BasicCredentials**[ERROR HERE = maybe a class implements Personal ??]**> ldapAuthenticator = new CachingAuthenticator<**[ERROR HERE = cannot infer arguments]**>(
                environment.metrics(),
                new ResourceAuthenticator(new LdapAuthenticator(ldapConfiguration)),
                ldapConfiguration.getCachePolicy());
environment.jersey().register(new AuthDynamicFeature(
                new BasicCredentialAuthFilter.Builder<User>()
                        .setAuthenticator(ldapAuthenticator)
                        .setRealm("LDAP")
                        .buildAuthFilter()));
environment.jersey().register(new AuthValueFactoryProvider.Binder<>(BasicCredentials.class**[ERROR HERE = maybe a class implements Personal ??]**));
environment.healthChecks().register("ldap", new LdapHealthCheck<**[ERROR HERE = cannot infer arguments]**>(new LdapCanAuthenticate(ldapConfiguration)))
chrisgray commented 7 years ago

Sorry about that! I just update the example in the readme to be correct I also added an ExampleApp implementation for reference!

https://github.com/yammer/dropwizard-auth-ldap/blob/master/src/test/java/com/yammer/dropwizard/authenticator/tests/ExampleAppTest.java