tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: REST service with JAAS auth trouble (TomEE+ 1.5.2)
Date Sat, 12 Oct 2013 16:07:10 GMT
works on trunk with:

┌( rmannibucau @ ubuntu )─( 1.7.0_40 -:- 3.1.0 )
└( /tmp/apache-tomee-plus-1.6.0-SNAPSHOT )·> cat conf/groups.properties
manager-gui=tomee


┌( rmannibucau @ ubuntu )─( 1.7.0_40 -:- 3.1.0 )
└( /tmp/apache-tomee-plus-1.6.0-SNAPSHOT )·> cat conf/users.properties
tomee=tomee


*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/10/12 Romain Manni-Bucau <rmannibucau@gmail.com>

> Hi
>
> maybe test on our snapshot, we had issues using logged user in the same
> request as the login
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
>
>
>
> 2013/10/12 gollum <chiliconlatte@gmail.com>
>
>> Ok, maybe I've misused the term "login" here. What I'm trying to do in
>> first
>> place is not to login into a session or so. I just want to restrict access
>> to a url for a defined set of users.
>>
>> My first test case was this simple REST service that does nothing but
>> returning the callers user name:
>>
>> @Stateless
>> @Path("/api")
>> @Produces({MediaType.TEXT_PLAIN})
>> public class SecureService {
>>
>>   @Resource
>>   SessionContext ctx;
>>
>>   @GET
>>   @Path("/hello")
>>   public Response hello() {
>>     Principal principal = ctx.getCallerPrincipal();
>>     return Response.ok("Hello "+principal.getName()).build();
>>   }
>> }
>>
>> This service is packaged and deployed as "secure.war"
>> When addressing the service at http://localhost/secure/api/hello the
>> browser
>> should prompt me for credentials, and after entering "admin:admin" the
>> service should reply with "Hello admin", which is true when I define
>> tomcat-users.xml as authentication realm in server.xml.
>> However, when I set up a JAAS PropertiesLogin realm like posted above, I
>> cannot access that url. The web browser just keeps prompting for
>> credentials, over and over.
>> The web.xml for this service is included in my first post.
>>
>> As another test, I tried to configure the TomEE built in manager webapp in
>> the same way, but the results are the same.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/REST-service-with-JAAS-auth-trouble-TomEE-1-5-2-tp4665513p4665567.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message