question

Julian Spillane avatar image
Julian Spillane asked

Nintendo Switch & Unity: 400 Bad Request

Hello,

I've scoured through the forum posts on both here and the Nintendo Developer Forums and I can't seem to find a clear solution to the issue we're encountering.


We're trying to authenticate users via the LoginWithNintendoServiceAccount API call and it's failing 100% of the time with a 400 Bad Request error.

We're successfully obtaining an NSA auth token and the JSON seems like it's valid. We've also set up our Client ID in the PlayFab Add On Dashboard using our Switch Application ID (minus the 0x prepend).

Is there anything that we're missing here?

Thanks!

-Julian Spillane

apisAuthenticationPartner Add-ons
4 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.

matthewhilson avatar image matthewhilson commented ·

Hey, we have started to get this issue as well, is there something PlayFab needs to do for it to be enabled on the client side?

0 Likes 0 ·
matthewhilson avatar image matthewhilson matthewhilson commented ·

We have sent off the Middleware verification from the Switch portal, and verifed we're getting back the correct token alongside having the correct application id under the PlayFab Switch addon page (without the 0x prefix)

0 Likes 0 ·
matthewhilson avatar image matthewhilson matthewhilson commented ·

Figured it out, we needed to do an array copy on the returned token from Nintendo before converting the byte array to a string. This post on the fourms helped

https://developer.nintendo.com/group/development/g1kr9vj6/forums/english/-/gts_message_boards/thread/295655544#latest

0 Likes 0 ·
Show more comments

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered
8 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.

Julian Spillane avatar image Julian Spillane commented ·

Hi Citrus,

Our title ID is: CD52

Here's the breakdown of the error:

Error: ServiceUnavailable

ErrorDetails: (empty string)

HttpCode: 400

HttpStatus: BadRequest

Thanks!

0 Likes 0 ·
Julian Spillane avatar image Julian Spillane commented ·

I think this might be an endpoint/API permissions thing, because if I use Postman to try and call that API call, I get an InvalidAPIEndpoint error back. If I do a standard LoginWithCustomID, however, it works just fine.

0 Likes 0 ·
Julian Spillane avatar image Julian Spillane Julian Spillane commented ·

I've also found this post on the Nintendo Dev forums that seems to imply that there's something up with the way the NSA token ID is converted to a string on dev hardware when sending via the PlayFab SDK:

https://developer.nintendo.com/group/development/g1kr9vj6/forums/english/-/gts_message_boards/thread/295655544#1028221

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Julian Spillane commented ·

Not sure whether it's related: did you verify your registered developer status with Nintendo? As per:

"In the Getting Started section of the Nintendo developer portal, click on "NX Middleware". That will take you to the licensed middleware listing, where you can find PlayFab. Click "learn more" there, then fill out your information on the confirmation form and click "Submit". That'll automatically send us an email with all the relevant information."

1 Like 1 ·
Julian Spillane avatar image Julian Spillane commented ·

@Citrus Yan

Yes, I submitted that info last week but haven't heard anything back from the PlayFab team. I just assumed it was automatic. Is there any way for you to confirm that it went through?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Julian Spillane commented ·

Just heard from the team, the auth call works without us doing anything on our side, for all titles, therefore I don't think there is a problem with that.

And unfortunately, we cannot debug more details about this here in this forum as that's all under NDA with Nintendo. Please find more info in the Nintendo Developer Forum, someone from our team will provide more information.

0 Likes 0 ·
Julian Spillane avatar image Julian Spillane Citrus Yan commented ·

Hi @Citrus Yan

I've made a post in the Nintendo dev forums ( https://developer.nintendo.com/group/development/g1kr9vj6/forums/english/-/gts_message_boards/thread/303836270 ) if you wouldn't mind pointing someone in the dev team to that thread.

Thank you for your help so far.

0 Likes 0 ·
Show more comments

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.