Skip to Content

HCP IOT MMS: Access to the requested resource is not authorized.

Hi,

I am creating a IOT application on HCP. I have 1 message type, 1 device type with OAuth token and 2 devices with OAuth token.

I am using POSTMAN to post HTTP request. I get the following error.

<!DOCTYPE html>
<html>
    <head>
        <title>SAP Cloud Platform IoT Service</title>
        <link rel="stylesheet" type="text/css" href="css/main.css" />
        <style type="text/css"></style>
    </head>
    <body style="background-color: #ffffff;">
        <p>Access to the requested resource is not authorized (HTTP 401).</p>
    </body>
</html>

This is my config

Please share your inputs.

sap-iot.jpg (112.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 04, 2017 at 09:45 PM

    Hello Sandeep, by definition you may have only one single "Authorization" header [1] in your HTTP request. Make sure you use one supplied with oath token of your device (not device type token) and check that the HTTP POST url ends with the device ID. Also, be aware that Postman may re-use your browser session, so I suggest to close all browser windows where you have been authenticated with SAML against SAP Cloud Platform (Cockpit etc). Regards, Anton

    [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

    Add comment
    10|10000 characters needed characters exceeded

    • You have masked the values on screenshots but just based on their length, I have a feeling you used device id as Bearer and put oauth token to URL. This should be opposite: ../v1/api/http/data/device-id and Bearer oauth-token. Also, check the browser session sspect from my last comment. Regards, Anton

  • Jul 05, 2017 at 11:30 AM

    Thanks Anton. You are right. I closed all browsers,cleared cache and history, re-deployed the MMS and voila! it worked.

    Thank you once again.

    Add comment
    10|10000 characters needed characters exceeded