glassfish
  1. glassfish
  2. GLASSFISH-9289

SecurityContext return PrincipalImpl for custom login and realm

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 9.0pe
    • Fix Version/s: future release
    • Component/s: security
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      9,289

      Description

      Hello,
      I write custom login and realm for add attributes to Principal.
      I override commit() in my login class and call getSubject() for change
      PrincipalImpl object with my custom Principal.

      When server process to login, the constructor
      SecurityContext(String userName, Subject subject, String realm)
      set the initiator with new PrincipalImpl(userName)
      this.initiator = PrincipalGroupFactory.getPrincipalInstance(userName, realm);

      after SessionContext return this PrincipalImpl when call getCallerPrincipal().

      I've redirect this constructor on SecurityContext(Subject subject) and modify my
      login module for add new DistinguishedPrincipalCredential(Principal prin) to
      subject.getPublicCredentials().
      Now SessionContext return my custom Principal.

      Please reply me if it's good method and if you can modify this for futur version.
      Thanks.

        Activity

        Hide
        kumarjayanti added a comment -

        Will take a look. We have been discussing about this issue recently.

        Show
        kumarjayanti added a comment - Will take a look. We have been discussing about this issue recently.
        Hide
        kumarjayanti added a comment -

        Will consider this feature for V3.1

        Show
        kumarjayanti added a comment - Will consider this feature for V3.1
        Hide
        maisonneuve_michel added a comment -

        Thanks

        Show
        maisonneuve_michel added a comment - Thanks
        Hide
        kumarjayanti added a comment -

        Marking it for 4.0

        Show
        kumarjayanti added a comment - Marking it for 4.0

          People

          • Assignee:
            JeffTancill
            Reporter:
            maisonneuve_michel
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: