Discovery: Rest API authorization issue: When using the Swagger UI, the API key generated from "Generate API Token" returns response code 401

Version 5
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    BMC Discovery


    COMPONENT:

    BMC Discovery 11.3


    APPLIES TO:

    BMC Discovery



    QUESTION:

    When using the Swagger UI, the API key authorization doesn't seem to work.

    The UI accepts the token , however testing with the API key generated from "Generate API Token" returns response code 401. 

     


    ANSWER:

    The doc at https://docs.bmc.com/docs/display/DISCO113/Authentication+and+permissions+in+the+REST+API says:
    "Following the OAuth 2.0 specification, every HTTP request to the API must contain an "Authorization" header with the value "bearer <your_token>"."

    When using swagger, it is necessary to add "bearer" in front of the token key when registering the API key authorization:

    User-added image

    See also https://communities.bmc.com/message/697080

     


    Article Number:

    000130451


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles