ssossossosso

Forums

Covering OroCRM topics, including community updates and company announcements.  Subscribe

Open-Source CRM software Forums OroCRM OroCRM – Programming Questions REST API – This token has no "digest" attribute

This topic contains 6 replies, has 2 voices, and was last updated by  Alexandr Smaga 2 years, 3 months ago.

  • Creator
    Topic
  • #7525

    Rodolfo
    Participant

    Hi guys,

    I’m trying to get some info using REST Api. I followed all the steps from “How to use WSSE authentication“.

    First point. I think this is outdated because it doesn’t accept username. Only the API KEY:php app/console oro:wsse:generate-header username

    So, using the API Key:
    crm-enterprise-application$ app/console oro:wsse:generate-header 20cb1b48abc8d305de31aeca2791d829d0b0a33a

    To use WSSE authentication add following headers to the request:
    Authorization: WSSE profile=”UsernameToken”
    X-WSSE: UsernameToken Username=”my_username”, PasswordDigest=”HdUCOD9LeX+wDSx2hCRp3jv8oMo=”, Nonce=”ZTZlOGEzNDE0ZDI3YzY1ZA==”, Created=”2014-12-09T14:15:04-05:00″

    crm-enterprise-application$
    curl -i -H “Accept: application/json” -H ‘Authorization: WSSE profile=”UsernameToken”‘ -H ‘X-WSSE: UsernameToken Username=”my_username”, PasswordDigest=”HdUCOD9LeX+wDSx2hCRp3jv8oMo=”, Nonce=”ZTZlOGEzNDE0ZDI3YzY1ZA==”, Created=”2014-12-09T14:15:04-05:00″‘ http://oro-production.local/app_dev.php/api/rest/latest/users

    HTTP/1.1 500 Internal Server Error
    Date: Tue, 09 Dec 2014 19:15:29 GMT
    Server: Apache/2.2.26 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.6 PHP/5.5.14 mod_ssl/2.2.26 OpenSSL/0.9.8za DAV/2 mod_perl/2.0.8 Perl/v5.18.2
    X-Powered-By: PHP/5.5.14
    Cache-Control: no-cache
    X-Debug-Token: f23608
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: application/json

    {“status”:”error”,”status_code”:500,”status_text”:”Internal Server Error”,”current_content”:””,”message”:”This token has no \”digest\” attribute.“}

    crm-enterprise-application$

    Thanks!

    My version:
    Oro: 1.4.2/1.6.2

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #7526

    Alexandr Smaga
    Participant

    Hello @rbandeira !

    Thanks for highlighting this! Doc is updated and waiting for review.
    Did you have any customization around security level on your CRM instance ? I’ve just tried to get data through the API and it works for me.
    Also I took a look to code and it seems that it should not generate wsse token if digest not found in header.

    #7527

    Rodolfo
    Participant

    Hi @asmaga !

    Thank you for your answer.

    The problem here is the version of my EscapeWSSEAuthenticationBundle. My vendor folder has the Listener.php from the master branch and not from v1.1.0 as you show me. This version doesn’t have:

    https://github.com/escapestudios/EscapeWSSEAuthenticationBundle/blob/master/Security/Http/Firewall/Listener.php

    #7528

    Rodolfo
    Participant
    #7533

    Alexandr Smaga
    Participant

    Ah sorry!
    Unfortunately changes in wsse bundle broke BC, it’s known issue and we already fix version of wsse on 1.0.2. Yes, please update it in you composer.

    #7545

    Rodolfo
    Participant

    Thank you @asmaga !

    Now it’s working fine here!

    I just have one more question. Why in my default OroCRM installation I have two vendor folders with the escapestudios?

    To make it working I had to change this composer: vendor/oro/platform/composer.json and then copy the folder: “vendor/oro/platform/escapestudios/wsse-authentication-bundle” to “vendor/escapestudions”.

    #7546

    Alexandr Smaga
    Participant

    It’s strange, because composer should download all dependencies for all packages in ROOT/vendor and it only reads composer file that placed in root folder. Did you run composer install twice in root and in vendor/oro/platform/ ?

Viewing 6 replies - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.