mixer / interactive-unity-plugin

Unity Plugin for Mixer Interactivity
MIT License
59 stars 23 forks source link

Can't obtain OAuth token #88

Closed gordonklarson closed 6 years ago

gordonklarson commented 6 years ago

I've been trying to run the example code included with the plugin. Nothing happens after checking the checkbox when running the scene. All I get is the following output from the server every few seconds:

Trying to obtain a new OAuth token. This is an expected and repeated call. InteractivityManager._Log() Assets/MixerInteractive/Source/Scripts/InteractivityManager.cs:3789 3787: return; 3788: } -->3789: UnityEngine.Debug.Log(message); 3790: }

InteractivityManager.TryGetTokenAsync() Assets/MixerInteractive/Source/Scripts/InteractivityManager.cs:501 499: private void TryGetTokenAsync() 500: { -->501: _Log("Trying to obtain a new OAuth token. This is an expected and repeated call."); 503: mixerInteractiveHelper.OnInternalWebRequestStateChanged -= OnRequestOAuthExchangeTokenCompleted;

InteractivityManager.OnInternalCheckAuthStatusTimerCallback() Assets/MixerInteractive/Source/Scripts/InteractivityManager.cs:496 494: private void OnInternalCheckAuthStatusTimerCallback(object sender, MixerInteractiveHelper.InternalTimerCallbackEventArgs e) 495: { -->496: TryGetTokenAsync(); 497: }

MixerInteractiveHelper.CheckAuthStatusBackgroundWorkerDoWork() Assets/MixerInteractive/Source/Scripts/MixerInteractiveHelper.cs:450 448: if (OnInternalCheckAuthStatusTimerCallback != null) 449: { -->450: OnInternalCheckAuthStatusTimerCallback(this, new InternalTimerCallbackEventArgs()); 451: } 452: }

_ThreadPoolWaitCallback.PerformWaitCallback()

payzer commented 6 years ago

This means that:

  1. The SDK has retrieved a short code and is displaying it to the user
  2. It is waiting for you to go to mixer.com/go and log in

After that it will obtain the OAuth token and continue.

Let us know if that fixes your issue?

gordonklarson commented 6 years ago

No code is being displayed. All I see is "Enter this code at http://mixer.com/go" and nothing else. I've also checked the AuthCode object in the scene and the Text component is set to the empty string.

payzer commented 6 years ago

Thank you, that means it must have failed to display the shortcode in the Unity UI (is the UI element hidden?). But it probably got one successfully otherwise it wouldn't get that far. It would have printed to debug output that it failed to retrieve a short code.

gordonklarson commented 6 years ago

I managed to get it to work finally. Created a new OAuth client in the mixer developer lab and it seemed to fix the issue. It's strange because all the settings are the same except for the client name.

djarcas commented 5 years ago

Thank you, that means it must have failed to display the shortcode in the Unity UI (is the UI element hidden?). But it probably got one successfully otherwise it wouldn't get that far. It would have printed to debug output that it failed to retrieve a short code.

Just a note - there's no code to display a failed get on the token, unless it's specifically a 404. I've been getting a 400 error, and there's no feedback at all from the unmodified source.