Configure Jabber external component to send stanza on behalf of any user [closed]

StackOverflow https://stackoverflow.com/questions/4213618

  •  26-09-2019
  •  | 
  •  

문제

I read somewhere a while ago that one can configure external jabber components (XEP-0114) to send XMPP stanza's on behalf on any user. For instance say i have a component bind to (component.localhost) and i want it to send a message stanza with "from" attribute set to "user@localhost".

I am trying to achieve this with ejabberd. Won't be surprised if I will have to hack down ejabberd src to get this working (if at all possible).

도움이 되었습니까?

해결책

If you are using ejabberd, you can use the {service_check_from, false} option in your service definition to disable the verification on the "from" attribute.

Keep in mind, though, that XEP 0114 requires that the "host" part of the JIDs match the name of the component.

See the corresponding section of ejabberd documentation for all the gory details.

다른 팁

Technically, you have to actually write the component, but this can easily be done. You have first to confugre ejabberd so that it accepts connections on a specific for your component, with a given componet JID and a password. The default configuration file has several examples, for gateways for example.

Once this is done, connect an XMPP library/client with this component's credential and you should be good to go! The only constraint is that you send valid XML.

Your component will typically only be allowed to send stanzas appearing to be from *@component.domain.com, rather than @.domain.com. This is a security feature.

If you want this functionality, you may have to write a server plugin rather than an external component.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top