question

Luis Garcia Remes avatar image
Luis Garcia Remes asked

I have followed the "Publish your first user generated content" tutorial but keep getting error 403

As stated in the title I have followed the tutorial found here. I am on the step where I use postman to upload the data to the url I created but I keep getting this error

<?xml version="1.0" encoding="UTF-8"?> -<Error> <Code>AuthenticationFailed</Code> <Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:71cd7112-901e-0038-1e9a-e76232000000 Time:2021-12-02T16:31:53.4308647Z</Message> <AuthenticationErrorDetail>Signature fields not well formed.</AuthenticationErrorDetail> </Error>

The tutorial does not mention anything about authirization settings

unity3d
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sarah Zhang avatar image Sarah Zhang commented ·

Do you mean you get the upload URL successfully and got the error “AuthenticationFailed” when you upload your file to the URL? For clarification, as the documentation - Publish your first user generated content - PlayFab | Microsoft Docs said, you need to add the headers comp: blob and x-ms-blob-type: blockblob for the PUT request for your uploading.

If you can’t locate where the issue is, could you please provide the complete request for our reference? Please hide the specific URL before you post the PUT request, it could be something like this.

PUT [UploadURL] 

HTTP/1.1
comp: blob
x-ms-blob-type: blockblob
User-Agent: PostmanRuntime/7.28.4
Accept: */*
Postman-Token: 76d4d360-247a-43d5-b33a-a0ee22bebf81
Host: pfcatalogcontent1.blob.core.windows.net
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 0
Content-Type: application/zip<br>
0 Likes 0 ·
Luis Garcia Remes avatar image Luis Garcia Remes Sarah Zhang commented ·

Yes, this is occurring after creating blob urls using the create blob url call.

Here is the put request headers:

x-ms-blob-type: blockblob

comp: blob

User-Agent: PostmanRuntime/7.28.4

Accept: */*

Postman-Token: ac0c0ae9-3c8e-4b1d-8be0-ef81241ea256

Host: pfcatalogcontent2.blob.core.windows.net

Accept-Encoding: gzip, deflate, br

Connection: keep-alive

Content-Length: 50604

Content-Type: image/png

After sending the request I receive a response with nothing in the body and these headers:

Content-Length: 0

Content-MD5: dc2SFJi4QyptRpHcrR0fOA==

Last-Modified: Fri, 03 Dec 2021 15:29:48 GMT

ETag: "0x8D9B671BE33AB45"

Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0

x-ms-request-id: 86009b11-c01e-0024-2b5a-e8ec48000000

x-ms-version: 2020-08-04

x-ms-content-crc64: TBNfDz9dmgE=

x-ms-request-server-encrypted: true

Date: Fri, 03 Dec 2021 15:29:47 GMT


I have been unable to upload data to the created blobs using either of your detailed methods. Btw the link to the postman beta github in the postman quickstart guide is broken.

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Thanks for your detailed clarification of the headers of PUT request. The headers you used is correct. I’m not very sure why your PUT request occurred the error “AuthenticationFailed” before. But, if currently the response body is empty, you should have uploaded the file successfully. You can check whether the status code of the request is 201 to determine whether the PUT request is successful. If the status code is 201, and the response body is empty, it means you have uploaded the file successfully.

For clarification, the files you uploaded won’t display in the [Game Manager] or in other places if you haven’t created the draft item for them. So, if you uploaded the file but can’t see it anywhere, this is normal.

As the documentation - Publish your first user generated content - PlayFab | Microsoft Docs said, you need to call the API CreateDraftItem to create the draft item and attach the file’s download URL as a property of the item.

You can obtain the file download URL via removing the parameters of the upload URL. For example, the download URL of this upload URL

https://pfcatalogcontent1.blob.core.windows.net/pf-title-xxxxxxxxx-xxxxxxxxxx/xxxxxxxxxxx/sprites.png?sv=xxxxxx&st=xxxxxx&se=xxxxxxx&sr=b&sp=c&sig=xxxxxxxxxxxxxxxxxxxxxxxx

is this. (You can also download the file using the GET request of the following URL.)

https://pfcatalogcontent1.blob.core.windows.net/pf-title-xxxxxxxxx-xxxxxxxxxx/xxxxxxxxxxx/sprites.png

For the questions of Postman Beta, the Beta/Private preview is only available for the limited Microsoft managed partners. It can be ignored. Please still access the repo - GitHub - PlayFab/PostmanCollection: PlayFab Postman Collection for the latest SDK features that has published or in public preview.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Luis Garcia Remes avatar image Luis Garcia Remes commented ·

After receiving an empty response from a put request (which you describe as meaning the upload succeeded). I send a get request (using the same url as you describe) that receives the following response.

<?xml version="1.0" encoding="utf-8"?> <Error> <Code>ResourceNotFound</Code> <Message>The specified resource does not exist. RequestId:cc46a7f7-601e-0066-71b7-eac75c000000 Time:2021-12-06T15:37:35.9309933Z</Message> </Error>

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Luis Garcia Remes commented ·

What is your http network status code? Is it 201 or other thing? Like 400, 403? And does the error - "Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature." still exist?

And please note, you need to replace the example URLs with your actual URLs to let the request work.

The upload URL should be the same as the URLs returned by API CreateUploadUrls. And the download URL should be the content URL mentioned in the documentation - Publish your first user generated content - PlayFab | Microsoft Docs.

We followed the documentation - Publish your first user generated content - PlayFab | Microsoft Docs to call the API CreateUploadUrls to create the URL, then use PUT request to upload the file to the complete URL. It can work fine.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]