Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Incorrect documentation for authenticating API requests

Discussion in 'Unity Cloud Content Delivery' started by dchipman, Apr 13, 2023.

  1. dchipman

    dchipman

    Joined:
    Jan 4, 2015
    Posts:
    38
    Per https://services.docs.unity.com/content-delivery-management/v1/index.html#section/Authentication :
    Using a base64 encoded empty username in the username : password pair (such as ':d6d2c026bac44b1ea7ac0332694a830e' from the example in the docs) returns a 401 failure with error code 51, which indicates a malformed auth token (https://services.docs.unity.com/docs/errors/#51).

    However, using the API key as the username and API secret as the password results in a successful request.
     
  2. SebT_Unity

    SebT_Unity

    Unity Technologies

    Joined:
    Jun 21, 2021
    Posts:
    279
    Hi dchipman,
    Thanks for reporting this.

    Could you just confirm my understanding you are able to login as the document suggests additionally you can login with the API key as the username and API secret as the password?

    What software are you using to make your API calls?
     
  3. dchipman

    dchipman

    Joined:
    Jan 4, 2015
    Posts:
    38
    Hey SebT, my apologies, it looks like my wires may have gotten crossed. I was making an API call via curl for a Multiplay endpoint (https://docs.unity.com/game-server-hosting/en/manual/guides/api-build-workflow) which links to the CCD docs right next to the sample I was working with. I did not realize I was looking at the docs for Cloud Content Delivery, and it's the Multiplay API that requires username : password for the auth token whereas CCD just wants : password. Someone must've seen my link and moved it over to this CCD forum. It is a little confusing that different services may have different auth patterns, but I was able to authenticate for the Multiplay APIs.