Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security using RolesAllowed not always working #2729

Closed
eduarddrenth opened this issue May 16, 2018 · 8 comments
Closed

security using RolesAllowed not always working #2729

eduarddrenth opened this issue May 16, 2018 · 8 comments
Labels
PR: TESTS REQUIRED PR Requires Tests to be merged

Comments

@eduarddrenth
Copy link

Description


Context

same application (exact same war), same payara version, same java version, identical, automated payara configuration

Problem

on one machine RolesAllowed works on the other I am allowed updates without the correct role.

Expected Outcome

When I do not have the correct role I am not allowed to execute annotated method

Current Outcome

When I do not have the correct role I am allowed to execute annotated method

Steps to reproduce (Only for bug reports)

No steps yet, but relevant snippets:

In Controller:

    @Inject
    @Override
    protected void initCrudWriteService(@StdwCrudBean Auditing crudWriteService) {


@Local({CrudReadService.class, Auditing.class, StdwCrudService.class})
@Stateless
@StdwCrudBean
public class CrudServiceBean extends AbstractCrudServiceEnvers implements StdwCrudService {
.
.
    @Transactional
    @RolesAllowed(EDITORROLE)
    @Override
    public <T extends Serializable> T update(T t) {
.
.
        return super.update(t); // super code see below
    }
.
.
    @Transactional
    @TransactionAttribute
    @Override
    @RolesAllowed(value = {EDITORROLE})
    public <T extends Serializable> T update(T t) {
            return getEntityManager().merge(t);
    }


servlet setup

Environment

  • Payara Version: 5.181
  • Edition: full
  • JDK Version: 1.8.0_171-8u171-b11-0ubuntu0.16.04.1-b11
  • Operating System: both environments ubuntu 16.04
  • Operating System: linux 4.4.0-119-generic for working environment
  • Operating System: linux 2.6.32-042stab128.2 for not working environment
  • Database: MySQL
@eduarddrenth
Copy link
Author

The file realm:

screenshot from 2018-05-16 16-31-35

@eduarddrenth
Copy link
Author

Now, after again a lot of testing on the problematic server, deploying the same war that did not work before, all of a sudden it works as expected. Caching server side of some form?

@eduarddrenth
Copy link
Author

Perhaps these are of influence?

set configs.config.server-config.admin-service.das-config.autodeploy-enabled=false
set configs.config.server-config.admin-service.das-config.dynamic-reload-enabled=false

Thing is how it stands I cannot be sure security is ok, I have to test each deployment and if it doesn't work I don't have a fix.

@smillidge
Copy link
Contributor

Can you provide a reproducible test case?

@smillidge smillidge added the PR: TESTS REQUIRED PR Requires Tests to be merged label May 23, 2018
@eduarddrenth
Copy link
Author

No, that's the frustrating thing, all I can do is upload the war that I saw the problem with and scripts to make it run, it will be like the reproducer in #2625. If that's ok I can provide that, but I suspect it will just run fine.

@smillidge
Copy link
Contributor

I will close now. If you can create a reusable test case then please indicate below and we will reopen. Alternatively if a reproducer is difficult this can be investigated under a support contract with Payara.

@eduarddrenth
Copy link
Author

Ok, sorry I left it open, haven't seen anything unusual anymore...

@smillidge
Copy link
Contributor

glad to hear it is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: TESTS REQUIRED PR Requires Tests to be merged
Projects
None yet
Development

No branches or pull requests

2 participants