question

travis-1 avatar image
travis-1 asked

SecretKey versus X-SecretKey in header

Authentication
1 comment
10 |1200

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

travis-1 avatar image travis-1 commented ·

So I am trying to build a reset password solutions your online docs here

https://docs.microsoft.com/en-us/rest/api/playfab/admin/account-management/resetpassword?view=playfab-rest

Mention SecretKey after 2 days of failing to get it to work I downloaded your postman examples they use

X-SecretKey once I changed to that all was fine. Is this just a documents are out of date issue or is the a difference?

Travis

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

May I ask what is your development environment? Have you implemented any version of SDK in your project? The Secret Key is a defined name of the feature and X-SecretKey is the name of the parameter that stores the secret key in the HTTP header of Postman SDK. There can be differences on name definition when it comes to different SDKs. For example, in Unity SDK, it can be retrieved via PlayFabApiSettings.DeveloperSecretKey. (if server/admin API is enabled.) This should be encapsulated in many SDKs so that you don’t have to manually craft the raw HTTP request.

10 |1200

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

travis-1 avatar image
travis-1 answered

Hello my environment is really not the issue at all.

The issue is your online documentation still just says SecretKey at the link below as apposed to X-SecretKey.

https://docs.microsoft.com/en-us/rest/api/playfab/admin/account-management/resetpassword?view=playfab-rest

I did download the swagger generated api and I did see the value there was X-SecretKey My project is working I am only posting so you might notice the docs are wrong or out of date and have a chance to correct them.

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.

Seth Du avatar image Seth Du ♦ commented ·

As I have mentioned, “Secret Key” is a defined terminology of this feature. It is by design. I don't think there will be any changes on the documentation.

0 Likes 0 ·
travis-1 avatar image travis-1 commented ·

That is remarkable short sighted.

The comments read as follows

Request Header

TABLE 1
NameRequiredTypeDescription
SecretKey True
  • string
This API requires a title secret key, available to title admins, from PlayFab Game Manager.

Saying this is the request header then giving the wrong name for the header field is not just a terminology issue this reads as a technical document and without download your swagger open api spec I would never have seen this was not the correct header name.

It is of course your documentation but it wasted 2 days of my time working out your term was not in fact the correct value for the header. This is misleading and it's going to leave other developer confused latter too.

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.