Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Don't know use Access Tokens , private bucket

Discussion in 'Unity Cloud Content Delivery' started by Telperion1991, Jun 11, 2022.

  1. Telperion1991

    Telperion1991

    Joined:
    Nov 16, 2019
    Posts:
    4
    I have created a private bucket,
    For test, I get the Bucket Access Tokens: d107a7014d8de3b5d410ef902607b335,

    After reading the documentation, I realized that I need to authenticate the token in the form "username:password" and the username needs to be empty.

    So I use ":5675c7320b732302c5e08ed0e81c508a"
    Then got base64-encoded: "OjU2NzVjNzMyMGI3MzIzMDJjNWUwOGVkMGU4MWM1MDhh"

    Finally I executed the following code:

    Code (CSharp):
    1.             Addressables.WebRequestOverride = webRequest =>
    2.             {
    3.                 webRequest.SetRequestHeader("Authorization", "OjU2NzVjNzMyMGI3MzIzMDJjNWUwOGVkMGU4MWM1MDhh");
    4.                 Debug.Log($"Fetching: {webRequest.url}");
    5.             };
    6.             handle = Addressables.LoadAssetAsync<AudioClip>(auName);

    Got the error:mad::mad::mad:
    RemoteProviderException : Unable to load asset bundle from : https://7f946db4-cb70-4bb2-9159-8c7...s_all_3765caabd9a123364042eef62f516ce8.bundle
    UnityWebRequest result : ProtocolError : HTTP/1.1 401 Unauthorized
     
  2. kaanyalti

    kaanyalti

    Unity Technologies

    Joined:
    Dec 14, 2020
    Posts:
    8
    Hello @Telperion1991, I am looking into this issue, will get back to you as soon as possible
     
  3. kaanyalti

    kaanyalti

    Unity Technologies

    Joined:
    Dec 14, 2020
    Posts:
    8
    Hello @Telperion1991, sorry for the late response. You have to have "Basic" in front of the token. So your auth header should look like this "Basic OjU2NzVjNzMyMGI3MzIzMDJjNWUwOGVkMGU4MWM1MDhh"