question

dahltristan avatar image
dahltristan asked

Invalid Kongregate Token

Hey,
I'm busy trying to login with PlayFab through Kongregate and am getting the following error:
PlayFabError(InvalidKongregateToken, InvalidKongregateToken, 400 BadRequest)

I'd be grateful for any helping in finding out what's wrong with the kong token I'm submitting.

I've tried the following:
fcea8d8b-ba12-3456-b9e2-a12345678d03

"fcea8d8b-ba12-3456-b9e2-a12345678d03"

and

"{fcea8d8b-ba12-3456-b9e2-a12345678d03}"

I think the token itself should be fine, and I'm using the following method to attempt the login:



    public void LoginWithKongregate(string kongregateId, string authTicket){


        Debug.Log("LoginWithKongregate: " + kongregateId + ", " + authTicket);

        LoginWithKongregateRequest request = new LoginWithKongregateRequest(){

            TitleId = PlayFabTitleID,

            KongregateId = kongregateId,

            AuthTicket = authTicket,

            CreateAccount = true

        };



        PlayFabClientAPI.LoginWithKongregate(

            request, 

            (result) => 

            {

                PlayFabId = result.PlayFabId;

                Debug.Log("Got PlayFabID: " + PlayFabId);



                if(result.NewlyCreated)

                {

                    Debug.Log("(new account)");

                }

                else

                {

                    Debug.Log("(existing account)");

                }

                loginStatus = EPLayfabLogInStatus.LoggedIn;

            },



            (error) => 

            {

                Debug.Log("Error logging in player with kongregate ID, token is:" + authTicket + ", kongid is: " +kongregateId);

                Debug.LogError(error);

                loginStatus = EPLayfabLogInStatus.Error;

            }

        );

    }



Thanks in advance for any help!

-Tristan

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

The auth ticket should be a string, so the "ticketdetails" version would be the way to go. What is the Title ID you're testing? Can you check that the Kongregate API Key is set correctly in your Add-ons Marketplace settings?

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.

dahltristan avatar image dahltristan commented ·

Hey @Brendan, our PlayFab TitleID is "A072" and while I was using the wrong API key yesterday, I changed it now and am still getting the same error.

0 Likes 0 ·
dahltristan avatar image dahltristan commented ·

Thanks so much Brendan, turns out that I simply forgot to switch the secret api key from the 'real' version of the game to the key from our 'testing' game page.

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.