Rampart
  1. Rampart
  2. RAMPART-178

Easily obtain UserNameToken information at the Service

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      We talked about this feature in the ML [1] and the proposed way [2] is very complicated.
      So i propose to set the username (not the password) information as property to the messageContext, to get it easily and quickly in the service.

      I did this very easily myself:

      In the PWCBHanlder

      MessageContext msgCtx = MessageContext.getCurrentMessageContext();
      msgCtx.setProperty("username", pwcb.getIdentifer());

      [1] http://markmail.org/message/gya424dzg5hyid4w
      [2] http://wso2.org/library/169

        Activity

        Hide
        Stefan Lischke added a comment -

        unfrotunatly this does not work,

        MessageContext.getCurrentMessageContext();

        return null in PWCBHandler ;-(

        any other ideas?

        Show
        Stefan Lischke added a comment - unfrotunatly this does not work, MessageContext.getCurrentMessageContext(); return null in PWCBHandler ;-( any other ideas?
        Hide
        Nandana Mihindukulasooriya added a comment -

        I think this something Rampart Handlers should do, not the password callback handler. Will implement this feature in Rampart.

        I think getting the null is quite reasonable. Because this currentMessageContext property is set by the message receiver, so it won't be available at Password callback handler ( As password callback is being called before the flow comes to Message Receiver ). This currentMessageContext is to be used by Service Impl or units after message recievers.

        Show
        Nandana Mihindukulasooriya added a comment - I think this something Rampart Handlers should do, not the password callback handler. Will implement this feature in Rampart. I think getting the null is quite reasonable. Because this currentMessageContext property is set by the message receiver, so it won't be available at Password callback handler ( As password callback is being called before the flow comes to Message Receiver ). This currentMessageContext is to be used by Service Impl or units after message recievers.
        Hide
        Nandana Mihindukulasooriya added a comment -

        Fixed in the trunk. Now you can get the username that was used to authenticate using

        MessageContext.getCurrentMessageContext().getProperty(RampartMessageData.USERNAME);

        in side the service Impl.

        thanks,
        nandana

        Show
        Nandana Mihindukulasooriya added a comment - Fixed in the trunk. Now you can get the username that was used to authenticate using MessageContext.getCurrentMessageContext().getProperty(RampartMessageData.USERNAME); in side the service Impl. thanks, nandana
        Hide
        Nandana Mihindukulasooriya added a comment -

        Fixed.

        Show
        Nandana Mihindukulasooriya added a comment - Fixed.

          People

          • Assignee:
            Nandana Mihindukulasooriya
            Reporter:
            Stefan Lischke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development