Source:
<code>protected void configure() { install(new ServletModule() { @Override protected void configureServlets() { filter("/*").through(RequestCleanupFilter.class); } }); if (wantSSL) { install(new RequireSslFilter.Module()); } switch (authType) { case OPENID: install(new OpenIdModule()); break; case HTTP: case HTTP_LDAP: install(new HttpAuthModule()); break; case LDAP: case LDAP_BIND: install(new LdapAuthModule()); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: install(new ServletModule() { @Override protected void configureServlets() { serve("/become").with(BecomeAnyAccountLoginServlet.class); } }); break; default: throw new ProvisionException("Unsupported loginType: " + authType); } install(new UrlModule()); install(new UiRpcModule()); install(new GerritRequestModule()); install(new ProjectServlet.Module()); bind(GitWebConfig.class).toInstance(gitWebConfig); if (gitWebConfig.getGitwebCGI() != null) { install(new GitWebModule()); } bind(ContactStore.class).toProvider(ContactStoreProvider.class).in( SINGLETON); bind(GerritConfigProvider.class); bind(GerritConfig.class).toProvider(GerritConfigProvider.class); bind(AccountManager.class); bind(ChangeUserName.CurrentUser.class); factory(ChangeUserName.Factory.class); factory(GeneratePassword.Factory.class); bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider( HttpRemotePeerProvider.class).in(RequestScoped.class); install(WebSession.module()); <START> bind(WebSession.KeyGenerator.class).in(SINGLETON); <END> bind(CurrentUser.class).toProvider(HttpCurrentUserProvider.class).in( RequestScoped.class); bind(IdentifiedUser.class).toProvider(HttpIdentifiedUserProvider.class).in( RequestScoped.class); }</code><technical_language>I put this bind of WebSession.module(), a private detail of WebSession</technical_language>

Target:
protected void configure() { install(new ServletModule() { @Override protected void configureServlets() { filter("/*").through(RequestCleanupFilter.class); } }); if (wantSSL) { install(new RequireSslFilter.Module()); } switch (authType) { case OPENID: install(new OpenIdModule()); break; case HTTP: case HTTP_LDAP: install(new HttpAuthModule()); break; case LDAP: case LDAP_BIND: install(new LdapAuthModule()); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: install(new ServletModule() { @Override protected void configureServlets() { serve("/become").with(BecomeAnyAccountLoginServlet.class); } }); break; default: throw new ProvisionException("Unsupported loginType: " + authType); } install(new UrlModule()); install(new UiRpcModule()); install(new GerritRequestModule()); install(new ProjectServlet.Module()); bind(GitWebConfig.class).toInstance(gitWebConfig); if (gitWebConfig.getGitwebCGI() != null) { install(new GitWebModule()); } bind(ContactStore.class).toProvider(ContactStoreProvider.class).in( SINGLETON); bind(GerritConfigProvider.class); bind(GerritConfig.class).toProvider(GerritConfigProvider.class); bind(AccountManager.class); bind(ChangeUserName.CurrentUser.class); factory(ChangeUserName.Factory.class); factory(GeneratePassword.Factory.class); bind(SocketAddress.class).annotatedWith(RemotePeer.class).toProvider( HttpRemotePeerProvider.class).in(RequestScoped.class); install(WebSession.module()); bind(CurrentUser.class).toProvider(HttpCurrentUserProvider.class).in( RequestScoped.class); bind(IdentifiedUser.class).toProvider(HttpIdentifiedUserProvider.class).in( RequestScoped.class); }