Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3206

@DeclareRoles throws exception when accessing EJB methods

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • None
    • 8.0.0.Final
    • EJB, Security
    • None

    Description

      When calling the getWisdom() method from the EJB below from a rest resource (principal = anonymous), it throws an exception. If I add @PermitAll it does not throw an exception.
      According to jsr-250: "the @DeclareRoles would be used to define roles that could be tested. It could also be used to declare roles that are not implicitly declared as the result of their use in a RolesAllowed annotation on the class or a method of the class."

      @Singleton
      @DeclareRoles("dukes")
      public class Greetings {
      private String wisdom;

      @PostConstruct
      public void initialize()

      { wisdom = "Java Programming Language Rocks!!!"; }

      public void setWisdom(String wisdom)

      { this.wisdom = wisdom; }

      public String getWisdom()

      { return userid + " said " + wisdom; }

      }

      Attachments

        Activity

          People

            dlloyd@redhat.com David Lloyd
            dfranssen Dirk Franssen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: