Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Page: previous  1  2 
Avatar
Rotjoeng #16
Member since Jul 2006 · 14 posts
Group memberships: Members
Show profile · Link to this post
In reply to post ID 1194
Hi,

I need some help with this error please
<iq type='error'
    from='pubsub.xxx.be'
    to='admin@xxx.be'
    id='sub1'>
      <pubsub xmlns="http://jabber.org/protocol/pubsub">
        <subscribe jid="filip@xxx.be" node="/zembla/xmpp/gerrit" />
    </pubsub>
    <error xmlns="jabber:client" code="400" type="modify">
        <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
        <invalid-jid xmlns="http://jabber.org/protocol/pubsub#errors" />
    </error>
</iq>

this is info about the node
"pubsub - collection
FORM_TYPE - http://jabber.org/protocol/pubsub#meta-data
pubsub#title -
pubsub#description -
pubsub#subscribe - [b]1[/b]
pubsub#subscription_required - 0
pubsub#deliver_payloads - 0
pubsub#notify_config - 1
pubsub#notify_delete - 1
pubsub#notify_retract - 1
pubsub#presence_based_delivery - 0
pubsub#type -
pubsub#body_xslt -
pubsub#dataform_xslt -
pubsub#access_model - open
pubsub#publish_model - open
pubsub#language - English
pubsub#owner - zemblaadmin@office.softelligent.be
pubsub#itemreply - owner
pubsub#leaf_node_association_policy - all
pubsub#leaf_nodes_max - -1


I thought this way my node was subscribable by all jid's. I really have no idea why he isn't allowed

Jep 60 says:
If the bare JID portions of the JIDs do not match as described above and the requesting entity does not have some kind of admin or proxy privilege as defined by the implementation, the service MUST return a <bad-request/> error, which SHOULD also include a pubsub-specific error condition of <invalid-jid/>.

Example 31. JIDs do not match

<iq type='error'
    from='pubsub.shakespeare.lit'
    to='francisco@denmark.lit/barracks'
    id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscribe
        node='princely_musings'
        jid='bernardo@denmark.lit'/>
  </pubsub>
  <error type='modify'>
    <bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <invalid-jid xmlns='http://jabber.org/protocol/pubsub#errors'/>
  </error>
</iq>
Avatar
Alex #17
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please post you complete XML log which also shows the attempt of subscribing to the node.

Alex
Avatar
Rotjoeng #18
Member since Jul 2006 · 14 posts
Group memberships: Members
Show profile · Link to this post
<iq xmlns="jabber:client"
    id="agsXMPP_5"
    type="set"
    to="pubsub.xxx.be"
    from="zemblaadmin@xxx.be/agsXMPP">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <create node="filip" type="collection" />
        <configure>
        <x xmlns="jabber:x:data" type="submit">
            <field type="hidden" var="FORM_TYPE">
                <value>http://jabber.org/protocol/pubsub#node_config</value>
            </field>
            <field var="pubsub#node_type">
                <value>collection</value>
            </field>
            <field var="pubsub#collection">
                <value>/zembla/xmpp</value>
            </field>
            <field var="pubsub#publish_model">
                <value>open</value>
            </field>
        </x>
        </configure>
    </pubsub>
</iq>

<iq xmlns="jabber:client"
    id="agsXMPP_6"    
    type="set"
    to="pubsub.xxx.be"
    from="filip@xxx.be">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
        <subscribe
            node="/zembla/xmpp/filip"
            jid="filip@xxx.be" />
    </pubsub>
</iq>

<iq xmlns="jabber:client"
    from="pubsub.xxx.be"
    to="zemblaadmin@xxx.be/agsXMPP"
    type="error"
    id="agsXMPP_6">
    <pubsub xmlns="http://jabber.org/protocol/pubsub">
    <subscribe
        jid="filip@xxx.be"
        node="/zembla/xmpp/filip" />
    </pubsub>
    <error code="400" type="modify">
        <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
        <invalid-jid xmlns="http://jabber.org/protocol/pubsub#errors" />
    </error>
</iq>
Avatar
Alex #19
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
There is no result to your first query with id=agsXMPP_5
Avatar
Rotjoeng #20
Member since Jul 2006 · 14 posts
Group memberships: Members
Show profile · Link to this post
there is one, i forgot to post it.

The node is created.
Avatar
Jabberer #21
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
This if from the wildfire source:

  1. // Check if sender and subscriber JIDs match or if a valid "trusted proxy" is being used
  2. JID from = iq.getFrom();
  3. JID subscriberJID = new JID(subscribeElement.attributeValue("jid"));
  4. if (!from.toBareJID().equals(subscriberJID.toBareJID()) && !service.isServiceAdmin(from)) {
  5.     // JIDs do not match and requestor is not a service admin so return an error
  6.         Element pubsubError = DocumentHelper.createElement(QName.get("invalid-jid", "http://jabber.org/protocol/pubsub#errors"));
  7.     sendErrorPacket(iq, PacketError.Condition.bad_request, pubsubError);
  8.     return;
  9. }

are you sure that your Jid's match?
I think you posted not your original Jid and replaced some parts with xxx
Software Developer
AG-Software
Avatar
Rotjoeng #22
Member since Jul 2006 · 14 posts
Group memberships: Members
Show profile · Link to this post
its the same source

But it seems i cant let another jid(adminjid) subscribe a jid to a node where the adminjid is owner. So now i send an iq to the other jid, so it can subscribe himself. That way it works.
Avatar
Jabberer #23
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
normally you can if you are a service wide admin or an authorized proxy.

Quote by from JEP-0060:
If the specified JID is a bare JID or full JID, the service MUST at a minimum check the bare JID portion against the bare JID portion of the 'from' attribute on the received IQ request to make sure that the requesting entity has the same identity as the JID which is being requested to be added to the subscriber list. However, some implementations MAY enable the service administrator to configure a list of entities that are excluded from this check; those entities may be considered "trusted proxies" that are allowed to subscribe on behalf of other entities. In the same way, implementations MAY enable blacklisting of entities that are not allowed to perform specific operations (such as subscribing or creating nodes).

Look at the check in the wildfire code. You have to add the Jid which should be allowed to subscribe on behalf of other entities to the list of Service admins in Wildfire. Is there a list of service admins in the node configuration in wildfire?
  1. if (!from.toBareJID().equals(subscriberJID.toBareJID()) && !service.isServiceAdmin(from))
Software Developer
AG-Software
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page: previous  1  2 
Forum: agsXMPP RSS