Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error obtaining client JWT token #578

Open
emily-zall opened this issue Apr 26, 2024 · 0 comments
Open

error obtaining client JWT token #578

emily-zall opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@emily-zall
Copy link

Describe the bug
Error obtaining client JWT token. The cli command throws and error and the curl command returns nothing.

To reproduce
Follow steps from https://docs.opal.ac/getting-started/running-opal/run-opal-client/obtain-jwt-token/

pyenv activate opal
pip install opal-client
export MY_MASTER_TOKEN=tokenvalue
opal-client obtain-token MY_MASTER_TOKEN --server-url=https://svr-kestrel.platform.simbachain.com --type client
/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/opal_common/authentication/types.py:4: CryptographyDeprecationWarning: Use PrivateKeyTypes instead
  from cryptography.hazmat.primitives.asymmetric.types import (
/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/opal_common/authentication/types.py:4: CryptographyDeprecationWarning: Use PublicKeyTypes instead
  from cryptography.hazmat.primitives.asymmetric.types import (
Traceback (most recent call last):
  File "/Users/emilyzall/.pyenv/versions/opal/bin/opal-client", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/opal_client/cli.py", line 65, in cli
    opal_client_config.cli(
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/opal_common/confi/confi.py", line 276, in cli
    self.get_cli_object(
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/typer/main.py", line 683, in wrapper
    return callback(**use_params)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/opal_common/cli/commands.py", line 82, in obtain_token
    res = asyncio.run(fetch())
          ^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/opal_common/cli/commands.py", line 76, in fetch
    data = await res.json()
           ^^^^^^^^^^^^^^^^
  File "/Users/emilyzall/.pyenv/versions/opal/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1166, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://svr-kestrel.platform.simbachain.com/token')

I also tried the curl command and no result was returned

curl --request POST 'https://svr-kestrel.platform.simbachain.com/token' \
--header 'Authorization: Bearer MY_MASTER_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "type": "client",
}'

Expected behavior
jwt token obtained with no error

OPAL version
It's version 0.0.24 of the helm chart, but how do I check the OPAL version

@emily-zall emily-zall added the bug Something isn't working label Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant