Help

49 views
Skip to first unread message

Frédéric Nell

unread,
Feb 24, 2023, 3:52:46 AM2/24/23
to WildFly
Hi,

I tried to migrate to elytron security. Which work great with jaspic in Wildfly.

But it's an horror in arquillian.

I cannot simulate login, I got all my user and roles for test loaded. I can check them with username password through our own implementation. They are found.

But if I try to access the securityDomain, it's not present.

And if I try to send a rest request with @runAsClient I got 404. It seem that Widlfy doesn't start any Rest API Endpoint at all.

I'm using Wildfly 26.1.3.Final.

Thanks if anybody can tell me how to rest call my Wildfly in Arquillian embeded or simulate an authentication on my security context.

And cheers,
Frédéric

Wei Nan Li

unread,
Feb 24, 2023, 4:57:40 AM2/24/23
to Frédéric Nell, WildFly
On Fri, Feb 24, 2023 at 4:52 PM Frédéric Nell <nell.f...@gmail.com> wrote:
>
> Hi,
>
> I tried to migrate to elytron security. Which work great with jaspic in Wildfly.
>
> But it's an horror in arquillian.
>
> I cannot simulate login, I got all my user and roles for test loaded. I can check them with username password through our own implementation. They are found.
>
> But if I try to access the securityDomain, it's not present.
>
> And if I try to send a rest request with @runAsClient I got 404. It seem that Widlfy doesn't start any Rest API Endpoint at all.

The resteasy testsuite contains testcase as example that do client
request in Arquillian managed environment:

- https://github.com/resteasy/resteasy/blob/main/testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/client/ClientBuilderTest.java

>
> I'm using Wildfly 26.1.3.Final.
>
> Thanks if anybody can tell me how to rest call my Wildfly in Arquillian embeded or simulate an authentication on my security context.
>
> And cheers,
> Frédéric
>
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/8adf4a4d-cdd6-43f1-8db5-77ab6de195c2n%40googlegroups.com.



--
Cheers,
Wei Nan | JBoss

Frédéric Nell

unread,
Feb 25, 2023, 3:13:53 AM2/25/23
to Wei Nan Li, WildFly
Hello Wei :)

Thanks for the link, I already saw all the examples but somehow we are building a super shrinkwrap archive with the whole application which call our EJB's.

In our EJB's there's the Principal (java.security) who is in use.

My Problem is that I tried to simulate a callback within the arquillian test in order to be able to log me in in our application security. 

But I didn't find any programmatic callback example for elytron. I can authenticate my tests users which set a token in our database, but the Principal is never set as @requestscoped.

I'm new to security and I don't understand how to configure and set it. I think a Jaas security could made the tricks:


Wish you a nice day and cheers,
Frédéric


Wei Nan Li

unread,
Feb 25, 2023, 1:32:04 PM2/25/23
to Frédéric Nell, WildFly
On Sat, Feb 25, 2023 at 4:13 PM Frédéric Nell <nell.f...@gmail.com> wrote:
>
> Hello Wei :)
>
> Thanks for the link, I already saw all the examples but somehow we are building a super shrinkwrap archive with the whole application which call our EJB's.

If you can trim down the problem into a sample project it would be
helpful to analyse the problem.

>
> In our EJB's there's the Principal (java.security) who is in use.
>
> My Problem is that I tried to simulate a callback within the arquillian test in order to be able to log me in in our application security.
>
> But I didn't find any programmatic callback example for elytron. I can authenticate my tests users which set a token in our database, but the Principal is never set as @requestscoped.

I'm not sure I catch the meaning correctly. Currently it seems the
problems are mixed together: Arquillian + Elytron + REST client
request.

Maybe it's better to isolate the problems first. For example, run the
project outside Arquillian to see if the project works. If that's the
case, then analyze the problem inside the Arquillian managed
environment to see what's the difference. Because Arquillian itself
just wraps the project into WAR/EAR file and starts a WildFly server
to deploy the project, so there must be differences in the
environment. If there is a sample project I could better analyse the
problem.
Reply all
Reply to author
Forward
0 new messages