microsoft / xbox-live-unity-plugin

The Xbox Live Unity Plugin provides a way for developers in the Xbox Live Creators Program to quickly and easily integrate Xbox Live functionality into their Unity based game. For ID@Xbox developers, this Xbox Live Unity Plugin does not yet support all the features you will need. Instead, contact your Microsoft representative.
MIT License
167 stars 62 forks source link

Unity Xbox live association wizard wont run #309

Closed dhood55 closed 3 years ago

dhood55 commented 3 years ago

Hi, so Im having a problem trying to run the association wizard for xbox live. I left it for a while, but when i test on xbox, the user fails to sign in to the game, and looking into it, it looks like i need to get the association wizard working to properly sign in. Problem is, Im getting an error:

**Request Id: 16fd8eb8-88bd-4b2f-bb68-afb1cad62a00

Correlation Id: 5e30ff29-664b-4544-b0f4-569a9c5d0c35

Timestamp: 2020-08-08T17:54:23Z

Message: AADSTS50011: The reply URL specified in the request does not match the reply URLs configured for the application: 'c2353253-3cb4-44b8-9e8f-4ad741d393c7'.**

Im not understanding what urls to look at or what I should do here. Any help would be awesome, thanks

NoelStephensNILC commented 3 years ago

Same here, it appears that it could be potentially broken. See this post here: https://github.com/microsoft/xbox-live-unity-plugin/issues/308 If I figure out the issue I will post, but I am guessing based on the last comment of the above thread: "yes the association wizard is useless, one has to edit the xboxservice.config file manually. And generally this plugin is in serious need of a long overdue update." So, it would appear that others have had the same issue and just decided to edit the manifest and config file by hand (evidently that is all the wizard does for you).

NoelStephensNILC commented 3 years ago

So the association wizard source code isn't included in the repository...which means that there is no way to fix whatever bug is preventing it from logging into the dev network. This means that you most likely need to edit everything by hand. It would be great if someone at Microsoft could update their documentation on this and provide a "non-association wizard" version of instructions as opposed to instructions for something that is broken and can't be fixed unless someone at MS decides to include the source code to the association wizard in this repository. If I had the source code, then I could have tracked down why it is failing to login (could be something like a hard coded sign-in URI to many other issues but can't figure that out unless the source code to the tool is posted).

So, either include the Association Wizard source code or perhaps update the documentation and provide instructions that don't include this tool? https://docs.microsoft.com/en-us/gaming/xbox-live/get-started/setup-ide/creators/unity-win10/live-configure-xbl-in-unity

dhood55 commented 3 years ago

Well, I'm glad I'm not the only one in the boat. Same goes here, if I find a possible fix I'll post as well, thanks for the input though

NoelStephensNILC commented 3 years ago

Here is what I have so far: https://github.com/microsoft/xbox-live-unity-plugin/issues/306#issuecomment-672950120 The above link takes you to a previous thread where I recently posted a fix to getting things "moving forward". Basically reverting back to QFE2 as opposed to using the more recent QFE3 release got me much further down the road. Once you get that done you will want to do this (from the same previous thread): a) Open Xbox live\Configuration from Unity Menu b) Run "Open Configuration" c) Fill-up the documents with the proper values. Use the your product identity page (https://partner.microsoft.com/en-us/dashboard/products/XXXXXX/identity) for some data and XBox Live for other data like sandbox or titleid. d) Add the line "XboxLiveCreatorsTitle": true e) Build f) Open the project with visual studio g) Select the project and in the right-click menu run Publish\Associate app with the store... The association wizard under visual studio appears to work and properly associate the application with the app ID.

Basically, I have a title that should theoretically work at this point...tested within Unity Editor and all "seems to work fine" (setting aside the fact that it is all "pretend info" at that point).

I am 99.9% sure that I have the Partner Center entries/information set properly (as best as I can tell based on the forum entries). I know that I added my Xbox Live account to the valid accounts that can test within the Sandbox created for me via the Partner Center. My title should work on both Windows 10 devices and Xbox according to the partner center Submission information and Xbox Live info and I did enable the "Creators Club" option under the Xbox Live section for the Application.

However, it gets all the way to the point where it is going to attempt to sign-in the user, the xbox-live sign-in window pops up, and then errors out stating that the application is using an invalid token or is incorrectly configured. When I deploy to an Xbox One set to the appropriate Sandbox it gives me the same results.

I had just made the Application Submission today so I am wondering if there is some kind of latency in the registration process or the like?

Maybe you can follow the steps I outline in the above link plus the additional steps in this post and let me know if that gets you to the same place...and if you can actually sign in...or if you end up with the same issue.

NoelStephensNILC commented 3 years ago

So I finally got it to work.

Here are the steps you should make sure to go through if you are running into issues but have already gotten QFE2 or QFE3 integrated and working (I never got the QFE3 version of this plugin working so I used QFE2):

Step 1: Using a Text Editor or the like

In the XboxServices.config located in your Unity project's root folder (if one doesn't exist then make it) and make sure these values are filled out properly: { "PublisherId": "CN=00000000-0000-0000-0000-000000000000", "PublisherDisplayName": "", "PackageIdentityName": "", "DisplayName": "", "AppId": "", "ProductFamilyName": "", "PrimaryServiceConfigId": "00000000-0000-0000-0000-000000000000", "TitleId": 0, "Sandbox": "XXXXXX.##", "XboxLiveCreatorsTitle": true } Make sure you have properly filled out the Partner Center Application Information, Enabled Creators Club/Live, etc (Note: You might need to wait like up to 24 hours before trying to sign in)

Step 2: Using Unity Editor Then launch the Unity Editor via the Unity HUB. Then go to Edit->Project Settings->Publish Settings Look for the Certificate section.
Click "Create..." image Under the "Publisher" section take the PublisherId from the XboxServices.config file, remove the CN=, and paste just the HEX (alpha-numeric) values with dashes. You can add a password or not (up to you). Take Note of the Version Number in this area

Then build your Unity project File->Build Settings->Build make sure you use a new folder and/or delete contents of existing build folder as there might be legacy settings/files

Step 3: Using Visual Studio IDE Once the Unity side of the build is done, open the Visual Studio solution. Right click on the (Universal Windows) project and select "Publish->Associate App with the store" and select your game's name (there most likely will be no application ID found). Let the busy bar finish before selecting the name and hitting next or it could freeze Visual Studio.

Confirm the updated certificate information by double clicking the Package.appxmanifest file in the root folder of your (Universal Windows) project and selecting the "Packaging" tab.

You should see: Package Name: (should be the same as PackageIdentityName in your XboxServices.config) Package display name: (should be the same as DisplayName in your XboxServices.config) Version Number: (should be the same as the version number that was set in Unity mentioned above) Publisher: (should be the same as PublisherId in your XboxServices.config minus the CN=) Publisher display name: (should be the same as PublisherDisplayName in your XboxServices.config) Package family name: (should be the same as ProductFamilyName in your XboxServices.config)

If the above values match, then you should be able to build (x64 only) and run your game/application on the platforms you selected for your application's settings in the Partner Center Application registration process (you don't need to submit a packaged file to get this to work).

If you still run into issues then you might not have configured your targeted system for the right Sandbox: https://docs.microsoft.com/en-us/gaming/xbox-live/test-release/sandboxes/live-sandboxes-creators

Note: The steps above pretty much are the steps that the Association Wizard were supposed to do. If you are using the QFE2 release, then the Wizard will work. If somehow you get the QFE3 to build and run in Unity (I always ended up in DLL conflicts) then you can place your system into development mode and the right Sandbox by following the steps outlined in the live-sandboxes-creators link above. For Xbox One, as long as it is already in development mode it is super easy to switch to the appropriate sandbox as it is a setting right on the main dev console menu.

Either case, I think the error I was getting that stated something like "invalid token or is incorrectly configured" during the Xbox Live sign in process was that I had made the mistake of using the "PublisherDisplayName" value for the Certificate's Publisher value in Unity when creating the certificate when it should have been the "PublisherId" (XboxServices.config) minus the "CN=".

Hopefully this will help anyone else running into the same issues.

Cheers!

-N

dhood55 commented 3 years ago

Alright, so I was

So I finally got it to work.

Here are the steps you should make sure to go through if you are running into issues but have already gotten QFE2 or QFE3 integrated and working (I never got the QFE3 version of this plugin working so I used QFE2):

Step 1: Using a Text Editor or the like

In the XboxServices.config located in your Unity project's root folder (if one doesn't exist then make it) and make sure these values are filled out properly: { "PublisherId": "CN=00000000-0000-0000-0000-000000000000", "PublisherDisplayName": "", "PackageIdentityName": "", "DisplayName": "", "AppId": "", "ProductFamilyName": "", "PrimaryServiceConfigId": "00000000-0000-0000-0000-000000000000", "TitleId": 0, "Sandbox": "XXXXXX.##", "XboxLiveCreatorsTitle": true } Make sure you have properly filled out the Partner Center Application Information, Enabled Creators Club/Live, etc (Note: You might need to wait like up to 24 hours before trying to sign in)

Step 2: Using Unity Editor Then launch the Unity Editor via the Unity HUB. Then go to Edit->Project Settings->Publish Settings Look for the Certificate section. Click "Create..." image Under the "Publisher" section take the PublisherId from the XboxServices.config file, remove the CN=, and paste just the HEX (alpha-numeric) values with dashes. You can add a password or not (up to you). Take Note of the Version Number in this area

Then build your Unity project File->Build Settings->Build make sure you use a new folder and/or delete contents of existing build folder as there might be legacy settings/files

Step 3: Using Visual Studio IDE Once the Unity side of the build is done, open the Visual Studio solution. Right click on the (Universal Windows) project and select "Publish->Associate App with the store" and select your game's name (there most likely will be no application ID found). _Let the busy bar finish before selecting the name and hitting next or it could freeze Visual Studio_.

Confirm the updated certificate information by double clicking the Package.appxmanifest file in the root folder of your (Universal Windows) project and selecting the "Packaging" tab.

You should see: Package Name: (should be the same as PackageIdentityName in your XboxServices.config) Package display name: (should be the same as DisplayName in your XboxServices.config) Version Number: (should be the same as the version number that was set in Unity mentioned above) Publisher: (should be the same as PublisherId in your XboxServices.config minus the CN=) Publisher display name: (should be the same as PublisherDisplayName in your XboxServices.config) Package family name: (should be the same as ProductFamilyName in your XboxServices.config)

If the above values match, then you should be able to build (x64 only) and run your game/application on the platforms you selected for your application's settings in the Partner Center Application registration process (you don't need to submit a packaged file to get this to work).

If you still run into issues then you might not have configured your targeted system for the right Sandbox: https://docs.microsoft.com/en-us/gaming/xbox-live/test-release/sandboxes/live-sandboxes-creators

Note: The steps above pretty much are the steps that the Association Wizard were supposed to do. If you are using the QFE2 release, then the Wizard will work. If somehow you get the QFE3 to build and run in Unity (I always ended up in DLL conflicts) then you can place your system into development mode and the right Sandbox by following the steps outlined in the live-sandboxes-creators link above. For Xbox One, as long as it is already in development mode it is super easy to switch to the appropriate sandbox as it is a setting right on the main dev console menu.

Either case, I think the error I was getting that stated something like "invalid token or is incorrectly configured" during the Xbox Live sign in process was that I had made the mistake of using the "PublisherDisplayName" value for the Certificate's Publisher value in Unity when creating the certificate when it should have been the "PublisherId" (XboxServices.config) minus the "CN=".

Hopefully this will help anyone else running into the same issues.

Cheers!

-N

Alright, so when you manually configure your package, I didn't know you needed to add the 'XboxLiveCreatorsTitle' part. After adding that, my code ended up being fixed, so thank you!

Also, I am using an older version, at least 2 years older, of the Microsoft plugin because of the reason that the newer one I was working with wasn't working.