Skip to content

Commit

Permalink
add authentication configuration example
Browse files Browse the repository at this point in the history
  • Loading branch information
xvik committed Oct 15, 2015
1 parent 7570295 commit 1954666
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,22 @@ Injector injector = provider.get();
Most likely, requirement for injector instance means integration with some third party library.
Consider writing custom installer in such cases (it will eliminate need for injector instance).

##### Authentication

Authentication is a good case when injector is required externally:

```java
@Override
public void run(ExampleConfiguration configuration, Environment environment) {
environment.jersey().register(AuthFactory.binder(new BasicAuthFactory<String>(
InjectorLookup.getInjector(this).get().getInstance(SimpleAuthenticator.class),
"SUPER SECRET STUFF",
User.class)));
}
```

For more details see [wiki page](https://github.com/xvik/dropwizard-guicey/wiki/Authentication-integration)

### Classpath scan

Classpath scanning is activated by specifying packages to scan in bundle `.enableAutoConfig("package.to.scan")`.
Expand Down

0 comments on commit 1954666

Please sign in to comment.