config.setUsers(userMap); // and setRoles(rolesMap)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-08-08 6:31 GMT-07:00 Steve Goldsmith <[email protected]>:

> I understand that part, but you also have to add the user in
> tomcat-users.xml as well. How would you do that in tomee-embedded?
>
> On Fri, Aug 7, 2015 at 5:11 PM, Romain Manni-Bucau <[email protected]>
> wrote:
>
> > Hi, just add a web.xml as in any war
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com>
> >
> > 2015-08-07 13:48 GMT-07:00 sgjava <[email protected]>:
> >
> > > How you you use basic auth with TomEE Embedded? Any examples out there?
> > > This
> > > is basically what I use for testing:
> > >
> > >     /**
> > >      * Start EJB container. Create configuration, cache client and EJB
> > >      * container.
> > >      */
> > >     @BeforeClass
> > >     public static void setUpClass() {
> > >         try {
> > >             log.info("setUpClass()");
> > >             // Call super setUpClass
> > >             BaseTest.setUpClass();
> > >             // Get configuration
> > >             final Configuration config = getConfiguration();
> > >             final Map p = new HashMap();
> > >             p.put(Context.INITIAL_CONTEXT_FACTORY,
> > >
> >  "org.apache.openejb.core.LocalInitialContextFactory");
> > >             p.put("openejb.embedded.initialcontext.close ", "DESTROY");
> > >             p.put("openejb.embedded.remotable", "true");
> > >             p.put(EJBContainer.APP_NAME, "masblaster");
> > >             p.put(EJBContainer.PROVIDER, "tomee-embedded");
> > >             // Add WAR and MDB modules
> > >             p.put(EJBContainer.MODULES, new
> > > File[]{Archive.archive().copyTo(
> > >                 "WEB-INF/classes",
> > > jarLocation(OdnService.class)).asDir()});
> > >             // Random port
> > >             p.put(EmbeddedTomEEContainer.TOMEE_EJBCONTAINER_HTTP_PORT,
> > > "-1");
> > >             container = EJBContainer.createEJBContainer(p);
> > >         } catch (ConfigurationException e) {
> > >             log.error(e.getMessage());
> > >         }
> > >     }
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://tomee-openejb.979440.n4.nabble.com/Using-basic-auth-with-tomee-embedded-tp4675786.html
> > > Sent from the TomEE Users mailing list archive at Nabble.com.
> > >
> >
>
>
>
> --
> Steven P. Goldsmith
>

Reply via email to