0 Replies Latest reply on Mar 2, 2012 11:13 AM by alexander.steinbeisz

    Beehive API with Jersey Client (Java) - 403 - anticsrf is not recognized?

      Hello everyone!

      I have tried a littlebit with the BDK-Example for Java, but I am much more familar with the use of the jersey client. So my goal was to transform a test-script from bdk example into jersey code.
      The first steps and all steps without anticsrf are working well, but when using a request with the anticsrf param, then I allways get a 403.

      with the bdk script, i read the meeting entries to get the right meeting id, this string is then moved to jersey script, in order to test this. i used read and delete for meeting, because they do not have any additional parameters. that reduces the causes to the only parameter: anticsrf.

      1: Read Meeting with BDK (no anticsrf) - java code:

                     GetMethod getTest2 = new GetMethod("/comb/v1/d/invt/" + testMeetingId);
                     Meeting t2 = (Meeting) util.execute(Meeting.class, getTest2);

      2: Delete Meeting with BDK (with anticsrf) - java code:

                     DeleteMethod deleteTest = new DeleteMethod("/comb/v1/d/invt/" + testMeetingId + "?antiCSRF="+antiCSRF);

      3: Read Meeting with jersey - java code:

                     Meeting testMeeting = webResource.path("/comb/v1/d/invt/" + testID).get(Meeting.class);
      4: Delete Meeting with jersey - java code:

                webResource.path("/comb/v1/d/invt/" + testID).queryParam("antiCSRF", antiCSRF).delete();

      the code for 1,2 and 3 work very well, so i am able to read the information of the meeting if i have the right id
      but the code for 4 just results in:

      DELETE http://bee.local/comb/v1/d/invt/772E:2A87:invt:98C7611FF8CF4981885B2A20D237F158000000000000?antiCSRF=p7xODyqsb2k%3D returned a response status of 403

      it seems, that something with the urlencoded characters is not recognized in the right way.

      Any ideas?

      Edited by: alexander.steinbeisz on Mar 2, 2012 12:13 PM