MineDojo/Voyager

App Registration Entra Directives?

triple-it opened this issue · 6 comments

Before submitting an issue, make sure you read the FAQ.md

Briefly describe your issue

Is there some change required when using ENTRA id?
Do I need to add some scopes/roles?

Should the minecraft microsoft user, the same as the APP REGISTRATED owner user? Should it be in the same tenant?

Because I persistently get the following error..
~~
unauthorized_client: The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at https://go.microsoft.com/fwlink/?linkid=2083908.
~~

The other mc_port route is not documented for Voyager isn't? (So only the azure_login route)

Please provide your python, nodejs, Minecraft, and Fabric versions here

...

[If applicable] Please provide the Minefalyer and Minecraft logs, you can find the log under logs folder

...
minfaler logs still empty 0 bytes..

-rw-rw-r-- 1 triple_admin triple_admin 0 Feb 1 15:04 20240201_150438.log
-rw-rw-r-- 1 triple_admin triple_admin 0 Feb 1 15:06 20240201_150617.log
-rw-rw-r-- 1 triple_admin triple_admin 0 Feb 1 15:13 20240201_151305.log
-rw-rw-r-- 1 triple_admin triple_admin 0 Feb 1 15:18 20240201_151821.log

triple_admin@voyager1:~/src/Voyager$ python t1.py
/home/triple_admin/.local/lib/python3.10/site-packages/langchain/chat_models/init.py:31: LangChainDeprecationWarnin
g: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langc
hain==0.2.0. Please import from langchain-community instead:

from langchain_community.chat_models import ChatOpenAI.

To install langchain-community run pip install -U langchain-community.
warnings.warn(
/home/triple_admin/.local/lib/python3.10/site-packages/langchain/chat_models/init.py:31: LangChainDeprecationWarnin
g: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langc
hain==0.2.0. Please import from langchain-community instead:

from langchain_community.chat_models import ChatOpenAI.

To install langchain-community run pip install -U langchain-community.
warnings.warn(
/home/triple_admin/.local/lib/python3.10/site-packages/langchain/vectorstores/init.py:35: LangChainDeprecationWarni
ng: Importing vector stores from langchain is deprecated. Importing from langchain will no longer be supported as of la
ngchain==0.2.0. Please import from langchain-community instead:

from langchain_community.vectorstores import Chroma.

To install langchain-community run pip install -U langchain-community.
warnings.warn(
Creating Minecraft server
Please open https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?client_id=10034078-d9b3-4cc5-88a4-c9b82c1
8a448&response_type=code&redirect_uri=https%3A%2F%2F127.0.0.1%2Fauth-response&response_mode=query&scope=XboxLive.signin
+offline_access&state=5iF9mN2_0yM2o-SHKKfzIA&code_challenge=i0wwQe4msx_w14ALucASGyc2XGTeOCUWYh8VhyVFP5o&code_challenge_
method=S256 in your browser and copy the url you are redirected into the prompt below.

Url not valid

triple_admin@voyager1:/src/Voyager$
triple_admin@voyager1:
/src/Voyager$
triple_admin@voyager1:~/src/Voyager$
**

But I never receive a redirect url which I can use and paste yet..

If I need to present some more data, or do some other configuring/testing let me know.
I am happy to test-drive this software!

I had probably not selected "(Any Azure AD directory - Multitenant)" correctly. Because after retry of the whole install procedure now.. I don't encounter the problem.

I receive the url:
https://127.0.0.1/auth-response?code=M.C107_BAY.2.d02cfab5-32da-7eae-13e2-9ad0dc753f3e&state=kifzG4fu4qTuN17MWgCt4Q

This is what I can answer to my Python3 program I assume?

I will retry my TEST setup, and see if I can get everything to work now...
(Maybe rethink my iaas code of an automated Ubuntu 22.04 desktop install in the cloud idea, because that is not GPU optimal)

This issue is stale because it has been open for 30 days with no activity.

I found that there was an Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and also a Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) that were similar to the instructions. The important difference is the and personal Microsoft accounts part. I'd initially chosen the first one, got the same error as you did, re-created it using the second choice, and then things worked. That was probably the cause of your initial issue, and why re-creating (probably with the second option) caused the issue to go away.

Yeah, otherwise you hit on

   token_request = get_authorization_token(client_id, client_secret, redirect_uri, auth_code, code_verifier)
    token = token_request["access_token"]

And get some ugly error like

Creating Minecraft server
Please open https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize?client_id=ab6f193a-6b2d-47a4-9119-3a6d9084314d&response_type=code&redirect_uri=https%3A%2F%2F127.0.0.1%2Fauth-response&response_mode=query&scope=XboxLive.signin+offline_access&state=<STATE>&code_challenge=<CHALLENGE>&code_challenge_method=S256 in your browser and copy the url you are redirected into the prompt below.
https://127.0.0.1/auth-response?code=<CODE>&state=<STATE>
Traceback (most recent call last):
  File "/home/triple_admin/Voyager/t1.py", line 12, in <module>
    voyager = Voyager(
  File "/home/triple_admin/Voyager/voyager/voyager.py", line 104, in __init__
    self.env = VoyagerEnv(
  File "/home/triple_admin/Voyager/voyager/env/bridge.py", line 42, in __init__
    self.mc_instance = self.get_mc_instance()
  File "/home/triple_admin/Voyager/voyager/env/bridge.py", line 67, in get_mc_instance
    return MinecraftInstance(
  File "/home/triple_admin/Voyager/voyager/env/minecraft_launcher.py", line 36, in __init__
    self.mc_command = self.get_mc_command()
  File "/home/triple_admin/Voyager/voyager/env/minecraft_launcher.py", line 89, in get_mc_command
    login_data = minecraft_launcher_lib.microsoft_account.complete_login(
  File "/usr/local/lib/python3.10/dist-packages/minecraft_launcher_lib/microsoft_account.py", line 326, in complete_login
    token = token_request["access_token"]
KeyError: 'access_token'

Btw.. there is an "XboxLive.signin+offline_access" scope defined here..

This issue is stale because it has been open for 30 days with no activity.

This issue was closed because it has been inactive for 14 days since being marked as stale.