Announcement Announcement Module
Collapse
No announcement yet.
Dynamically Configure XMPP Client Username/Password Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dynamically Configure XMPP Client Username/Password

    I would like to use the XMPP support built into SI for a client app I am writing, allowing my users to send/receive messages to/from other users. We will have thousands of users, so I would like to dynamically set each client's XMPP username/password. I see the latest milestone 7 (and maybe earlier) provides an XMPP namespace which allows you to specify the client's XMPP credentials via XML:

    Code:
    <xmpp:xmpp-connection
      id="myConnection"
      user="user"
      password="password"
      host="host"
    ...
    />
    However, as I mentioned earlier, I will have thousands of users for this client so I need something a little more dynamic. I have the means to securely retrieve the XMPP credentials via a RESTful call, but how can I dynamically use these credentials within the SI client to establish an XMPP connection for my clients?

    I'm familiar with <contextroperty-placeholder> tag where you can leverage property files, but that would require me to write the credentials to disk which I can't do.

    I wonder if there is a way to use the new Java-based container configuration introduced in Spring 3.0 to create a bean with the credentials dynamically set as properties of the bean and then leverage these properties to configuration the SI XMPP connection via SpEL:

    Code:
    <xmpp:xmpp-connection
      id="myConnection"
      user="#{ T(<java.configuration.bean.class>).getUserName() }"
      password="#{ T(<java.configuration.bean.class>).getPassword() }"
      host="host"
    ...
    />
    Any thoughts or solutions?

  • #2
    authenticationevent

    you wait for a successfull authentication and load a context with its credentials,
    or on an AuthenticationSuccessEvent update a connection with its credentials

    Comment

    Working...
    X