The API REST TOKEN for Azure iot central does not work, 'SharedAccessSignature '

RAFAEL RODRIGUEZ 0 Reputation points
2023-07-05T04:30:34.9433333+00:00
#This error happens when i try to make a GET request in POSTMAN using a API REST token with administrator ROLE, i also tried with a BEARER TOKEN but it gets the same error
{
    "error": {
        "code": "Unauthenticated",
        "message": "The provided authentication token is invalid. You can contact support at https://aka.ms/iotcentral-support. Please include the following information. Request ID: ******, Time: Wed, 05 Jul 2023 04:19:14 GMT.",
        "requestId": "*******",
        "time": "Wed, 05 Jul 2023 04:19:14 GMT"
    }
}
Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
344 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 27,401 Reputation points
    2023-07-05T09:18:09.53+00:00

    RAFAEL RODRIGUEZ> Greetings!

    This error happens when i try to make a GET request in POSTMAN using a API REST token with administrator ROLE, i also tried with a BEARER TOKEN but it gets the same error

    Were you able to succeed without administrator role?

    Looks like the authentication token you provided is invalid. Here are a few things you can check to troubleshoot the issue:

    • Make sure that you are using the correct authentication token. If you are using a Shared Access Signature (SAS) token, double-check that the token is correctly formatted and includes the necessary permissions. If you are using a bearer token, make sure that the token is valid and has the necessary scopes.
    • Check that the token has not expired. If the token has expired, you will need to generate a new token.
    • Verify that the API endpoint URL is correct. Make sure that you are using the correct URL for the API endpoint and that the URL is correctly formatted.
    • Check that the API endpoint is accessible. Ensure that the API endpoint is accessible from your network and that there are no network issues preventing you from accessing the endpoint.

    To access an IoT Central application using the REST API, you can use an:

    • Azure Active Directory bearer token. A bearer token is associated with an Azure Active Directory user account or service principal. The token grants the caller the same permissions the user or service principal has in the IoT Central application.
    • IoT Central API token. An API token is associated with a role in your IoT Central application.

    Use a bearer token associated with your user account while you're developing and testing automation and scripts that use the REST API. Use a bearer token that's associated with a service principal for production automation and scripts. Use a bearer token in preference to an API token to reduce the risk of leaks and problems when tokens expire.

    To learn more about users and roles in IoT Central, see Manage users and roles in your IoT Central application.

    Also for more details, see How to authenticate and authorize IoT Central REST API calls and Authentication and authorization

    Hope this helps. Do let us know if you need any further help.

    0 comments No comments