Omniverse Microservice authentication not working in docker container

Hi, I am currently writing a microservice and trying to get authentication to work.

I have omniverse workstation on my local machine. The microservice is running in a docker container and I made sure, that it is able to at least reach my localhost. A complete working example is in [GitHub - phisn/Omniverse](Github Repository) (i know i shouldnt initialize inside a request, but i currently only want to get it working)

I ensured by logging in with token credentials, that my token is valid.

I opened a /bin/bash terminal inside the container and tried to curl host.docker.internal:3180 . I do get a html containing <title>Omniverse Authentication Form</title> . So it does not seem to be a connectivity issue.

I am currently using “register_authorize_callback” because “register_authentication_callback” is not yet supported in the newest docker image. I tried to return a tuple (“…”, “…”) and the real username password in authentication_callback. Am I missing something?

I am getting the following output including a authentication error when sending a get request to /hello-world.

[0.104s] [ext: omni.kit.pipapi-0.0.0] startup
[0.114s] [ext: omni.kit.pip_archive-0.0.0] startup
[0.130s] [ext: omni.usd.config-1.0.0] startup
[0.135s] [ext: omni.usd.libs-1.0.0] startup
[0.235s] [ext: omni.kit.loop-default-0.1.1] startup
[0.235s] [ext: omni.kit.async_engine-0.0.0] startup
[0.237s] [ext: omni.kit.test-0.0.0] startup
[0.384s] [ext: omni.services.facilities.base-1.0.2] startup
[0.386s] [ext: omni.services.core-1.2.0] startup
[0.547s] [ext: omni.services.transport.server.base-1.0.3] startup
[0.549s] [ext: omni.assets.plugins-0.0.0] startup
[0.550s] [ext: omni.services.transport.server.http-1.1.2] startup
[0.603s] [ext: omni.client-0.1.0] startup
[0.643s] app ready
$$$$ Omni Client initialized2.17.0-release.3265+tc.eb4515f1
[Main] [nucleus_connection] [LogLevel.VERBOSE] Connection library (version 0x000b001000000000, protocol version 1.19) settings:
[Main] [nucleus_connection] [LogLevel.VERBOSE]   Transfer settings:
[Main] [nucleus_connection] [LogLevel.VERBOSE]     contentBufferSize = 8589934592
[Main] [nucleus_connection] [LogLevel.VERBOSE]     receiveBufferSize = 8589934592
[Main] [nucleus_connection] [LogLevel.VERBOSE]     transmitBufferSize = 8589934592
[Main] [nucleus_connection] [LogLevel.VERBOSE]     maxTransferConnectionCount = 10
[Main] [nucleus_connection] [LogLevel.VERBOSE]     parallelTransferChunkSize = 1048576
[Main] [nucleus_connection] [LogLevel.VERBOSE]     lftContentBufferSize = 8589934592
[Main] [nucleus_connection] [LogLevel.VERBOSE]   Log settings:
[Main] [nucleus_connection] [LogLevel.VERBOSE]     logFile = 1
[Main] [nucleus_connection] [LogLevel.VERBOSE]     logTickStatistics = 0
[Main] [nucleus_connection] [LogLevel.VERBOSE]     logIncomingMessages = 1
[Main] [nucleus_connection] [LogLevel.VERBOSE]     logOutgoingMessages = 1
[Main] [nucleus_connection] [LogLevel.VERBOSE] OmniTrace unknown error while initializing
[Main] [provider_nucleus] [LogLevel.INFO] Initialized Nucleus API v11.16-e4b80979
[Main] [omniclient] [LogLevel.VERBOSE] Request 2: list(omniverse://host.docker.internal:3180/)
[Tick] [authentication] [LogLevel.INFO] Discovery(ws://host.docker.internal:3180/omni/discovery): Searching for services
[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a40025e0 connecting to ws://host.docker.internal:3180/omni/discovery
[Tick] [nucleus_connection] [LogLevel.VERBOSE] connecting to ws://host.docker.internal:3180/omni/discovery
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=1 DiscoverySearch.find 0x7f77a4004300
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=2 DiscoverySearch.find 0x7f77a4004300
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=3 DiscoverySearch.find 0x7f77a4004300
[Tick] [authentication] [LogLevel.INFO] Discovery(wss://host.docker.internal:3180/omni/discovery): Searching for services
[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a4007a20 connecting to wss://host.docker.internal:3180/omni/discovery
[Tick] [nucleus_connection] [LogLevel.VERBOSE] connecting to wss://host.docker.internal:3180/omni/discovery
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=1 DiscoverySearch.find 0x7f77a4004300
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=2 DiscoverySearch.find 0x7f77a4004300
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=3 DiscoverySearch.find 0x7f77a4004300
[Tick] [authentication] [LogLevel.INFO] Discovery(ws://host.docker.internal:3333): Searching for services
[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a40054a0 connecting to ws://host.docker.internal:3333
[Tick] [nucleus_connection] [LogLevel.VERBOSE] connecting to ws://host.docker.internal:3333/
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=1 DiscoverySearch.find 0x7f77a4004300
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=2 DiscoverySearch.find 0x7f77a4004300
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=3 DiscoverySearch.find 0x7f77a4004300
[47] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a400a290 wrong version number
[47] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a4008a10 Terminating connection
[47] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a4010120 Upgraded to WebSocket
2023-02-14 16:20:19 [9,836ms] [Warning] [omni.client.python] Waiting for a request that has taken longer than 20ms to complete: 
  File "/opt/nvidia/omniverse/kit-sdk-launcher/python/lib/python3.7/threading.py", line 890, in _bootstrap
  File "/opt/nvidia/omniverse/kit-sdk-launcher/python/lib/python3.7/threading.py", line 926, in _bootstrap_inner
  File "/opt/nvidia/omniverse/kit-sdk-launcher/python/lib/python3.7/threading.py", line 870, in run
  File "/opt/nvidia/omniverse/kit-sdk-launcher/python/lib/python3.7/concurrent/futures/thread.py", line 80, in _worker
  File "/opt/nvidia/omniverse/kit-sdk-launcher/python/lib/python3.7/concurrent/futures/thread.py", line 57, in run
  File "/hello_world.py", line 19, in hello_world
  File "/opt/nvidia/omniverse/kit-sdk-launcher/extscore/omni.client/omni/client/__init__.py", line 60, in list

[47] [nucleus_connection] [LogLevel.VERBOSE] >> id=1 {"found": true, "version": 2, "service_interface": {"origin": "OmniAuth.idl.ts", "name": "Credentials", "capabilities": {"get_settings": 0, "auth": 1, "register": 1, "reset": 0}}, "transport": {"name": "sows", "params": "{\"host\": \"127.0.0.1\", \"port\": 3100}", "meta": {"marshaller": "bs", "serializer": "json", "ssl": "false"}}, "meta": {"deployment": "external", "version": "1.4.5+main.teamcity.929.ee4634d5", "login_url": "http://*:3180"}}#
[47] [nucleus_connection] [LogLevel.VERBOSE] >> id=2 {"found": true, "version": 2, "service_interface": {"origin": "OmniAuth.idl.ts", "name": "Tokens", 
"capabilities": {"generate": 0, "refresh": 0, "subscribe": 0, "create_api_token": 0, "delete_api_token": 0, "get_api_tokens": 0, "auth_with_api_token": 
0}}, "transport": {"name": "sows", "params": "{\"host\": \"127.0.0.1\", \"port\": 3100}", "meta": {"marshaller": "bs", "serializer": "json", "ssl": "false"}}, "meta": {"deployment": "external", "version": "1.4.5+main.teamcity.929.ee4634d5", "login_url": "http://*:3180"}}#
[47] [nucleus_connection] [LogLevel.VERBOSE] >> id=3 {"found": true, "version": 2, "service_interface": {"origin": "omni1.idl.ts", "name": "Connection", "capabilities": {"add_user_to_group": 0, "auth": 3, "authorize_token": 2, "change_acl": 0, "checkpoint_version": 1, "copy": 1, "copy2": 1, "create": 2, "create_asset": 1, "create_asset_with_hash": 1, "create_directory": 0, "create_group": 0, "create_object": 1, "deep_copy_object_struct": 0, "delete": 0, "delete2": 0, "get_acl": 0, "get_acl_resolved": 0, "get_acl_v2": 0, "get_branches": 0, "get_checkpoints": 0, "get_group_users": 0, "get_groups": 0, "get_mount_info": 0, "get_transaction_id": 0, "get_user_groups": 0, "get_users": 0, "list": 4, "list2": 4, "lock": 2, "mount": 0, "ping": 0, "read": 1, "read_asset_resolved": 0, "read_asset_version": 0, "read_object_resolved": 0, "read_object_version": 0, "remove_group": 0, "remove_user_from_group": 0, "rename": 1, "rename2": 0, "rename_group": 0, "replace_version": 0, "service_resolve_acl": 1, "service_subscribe_list": 0, "set_acl_v2": 0, "set_path_options": 1, "set_path_options2": 0, "stat2": 1, "subscribe_list": 2, "subscribe_read_asset": 1, "subscribe_read_object": 2, "subscribe_server_notifications": 0, "unlock": 1, "unmount": 0, "update": 1, "update_asset": 1, "update_asset_with_hash": 1, "update_object": 1, "stop": 0}}, "transport": {"name": "connlib", "params": "{\n    \"url\": \"ws://127.0.0.1:3009\"\n}", "meta": {}}, "meta": {"deployment": "external"}}#
[47] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a4002d90 Remote server does not support WebSockets
[47] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a4002d90 Terminating connection$$$$ Authenticating to omniverse://host.docker.internal:3180

[Tick] [authentication] [LogLevel.INFO] Discovery(ws://host.docker.internal:3180/omni/discovery): Auth/Credentials search failed: Connection is terminated
[Tick] [authentication] [LogLevel.INFO] Discovery(wss://host.docker.internal:3180/omni/discovery): Auth/Credentials search failed: Connection is terminated
[Tick] [authentication] [LogLevel.INFO] Discovery(ws://host.docker.internal:3333): Found Auth/Credentials service using transport 'sows' {"host": "127.0.0.1", "port": 3100}
[Tick] [authentication] [LogLevel.INFO] Discovery(ws://host.docker.internal:3333): Found auth login_url http://*:3180
[Tick] [authentication] [LogLevel.INFO] Discovery(ws://host.docker.internal:3333): Found api url ws://127.0.0.1:3009
[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a40025e0 destroyed
[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a4007a20 destroyed
$$$$ Connection status to omniverse://host.docker.internal:3180 is ConnectionStatus.CONNECTING[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a40054a0 destroyed

$$$$ Connection status to omniverse://host.docker.internal:3180 is ConnectionStatus.CONNECT_ERROR
[Tick] [provider_nucleus] [LogLevel.INFO] Received username/password from application for omniverse://host.docker.internal:3180
[Tick] [provider_nucleus] [LogLevel.INFO] Connecting to omniverse://host.docker.internal:3180 as $omni-api-token using new authentication method        
[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a40054a0 connecting to ws://127.0.0.1:3100
[Tick] [nucleus_connection] [LogLevel.VERBOSE] connecting to ws://127.0.0.1:3100/
[Tick] [nucleus_connection] [LogLevel.VERBOSE] << id=1 Credentials.auth 0x7f77a4004300
[47] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a4010120 Terminating connection
[Tick] [authentication] [LogLevel.WARNING] Auth: Error retrieving result: Connection is terminated
[Tick] [nucleus_connection] [LogLevel.VERBOSE] 0x7f77a40054a0 destroyed
[Tick] [provider_nucleus] [LogLevel.INFO] Connecting to omniverse://host.docker.internal:3180 failed: Authorization failed
[Tick] [omniclient] [LogLevel.VERBOSE] Request 2: list(omniverse://host.docker.internal:3180/) returned Error: Connection with 0 entries

Hi @phisn. I saw more info about this on Discord. I’m sharing it with the dev team to see what they say.

hello @phisn - Here is a quick and very dirty example.
Microservice-v4-20230323_223430.pdf (26.3 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.