-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Labels
bugSomething isn't workingSomething isn't working
Description
- What versions are you using?
3.4.0
- Is it an error or a hang or a crash?
Error.
- What error(s) or behavior you are seeing?
Traceback (most recent call last):
File "src/oracledb/impl/base/connect_params.pyx", line 367, in oracledb.base_impl.ConnectParamsImpl._set_access_token
File "src/oracledb/impl/base/connect_params.pyx", line 294, in oracledb.base_impl.ConnectParamsImpl._get_token_expires
File "/Users/maros/.pyenv/versions/3.10.13/lib/python3.10/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/maros/Gitlab/dagster/data-ops/test.py", line 12, in <module>
conn = oracledb.connect(
File "/Users/maros/Library/Caches/pypoetry/virtualenvs/data-ops-pkPRkd2D-py3.10/lib/python3.10/site-packages/oracledb/connection.py", line 1698, in connect
return conn_class(dsn=dsn, pool=pool, params=params, **kwargs)
File "/Users/maros/Library/Caches/pypoetry/virtualenvs/data-ops-pkPRkd2D-py3.10/lib/python3.10/site-packages/oracledb/connection.py", line 868, in __init__
dsn = params_impl.process_args(dsn, kwargs, thin)
File "src/oracledb/impl/base/connect_params.pyx", line 567, in oracledb.base_impl.ConnectParamsImpl.process_args
File "src/oracledb/impl/base/connect_params.pyx", line 109, in oracledb.base_impl.ConnectParamsImpl.set
File "src/oracledb/impl/base/connect_params.pyx", line 387, in oracledb.base_impl.ConnectParamsImpl._set_access_token_param
File "src/oracledb/impl/base/connect_params.pyx", line 369, in oracledb.base_impl.ConnectParamsImpl._set_access_token
File "/Users/maros/Library/Caches/pypoetry/virtualenvs/data-ops-pkPRkd2D-py3.10/lib/python3.10/site-packages/oracledb/errors.py", line 199, in _raise_err
raise error.exc_type(error) from cause
oracledb.exceptions.ProgrammingError: DPY-2031: invalid access token: value must be a string (for OAuth), a 2-tuple containing the token and private key strings (for IAM), or a callable that returns a string or 2-tuple
Incorrect padding
- Does your application call init_oracle_client()?
No.
- Include a runnable Python script that shows the problem.
import oracledb
import azure.identity
access_token = azure.identity.DefaultAzureCredential().get_token("https://<hostname>/<db_name>/.default").token
conn = oracledb.connect(
host="<db_host>",
service_name="<db_service_name>",
access_token=access_token,
)
with conn.cursor() as cursor:
r = cursor.execute("SELECt 1 from dual").fetchall()
print(r)
cmp0xff and savansonii
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working