Oracle wallet authentication compatibility, userless & passwordless
yevon opened this issue · 9 comments
Within sqlplus or sqlcl you can setup userless and passwordless authentication if you have an auto-login wallet in your oracle_home directory. I don't see any way to setup this kind of db connections with oradew. Passwordless login works like this:
-
Create oracle wallet with mkstore and autologin:
-
wallet create -wallet "C:\Oracle\oracle_home\network\admin" -pwd "PASSWORD" -auto_login_local
-
Setup your tnsnames.ora as normal:
TNS_CONNECTION_NAME=
(description=
(address_list=
(address = (protocol = TCP)(host = yourhost)(port = yourport))
)
(connect_data =
(service_name=yourservicename)
)
)
-
Add an auto login credential to the wallet
mkstore -wrl "C:\Oracle\oracle_home\network\admin" -createCredential TNS_CONNECTION_NAME USER_NAME PASSWORD -
Then you can connect with sqlplus just with this command:
sqlplus /@TNS_CONNECTION_NAME
Is there a way to allow setup db configs without specifying user and password and just set up multiple connection strings for every environment? Users is mandatory, and I've tried not specifying any password but it asks me for the password when executing import objects from db.
DB config connection looks like this
{
"DEV":{
"connectString":"TNS_CONNECTION_NAME",
"users":[
{
"user": "?????"
, "password":"?????"
, "schemas":["USER_NAME"]
, "askForPassword": false
}
]
}
}
It would be nice having compatibility with config like this, making connectString at user level and user and password not required:
{
"DEV":{
"users":[
{
"connectString":"TNS_CONNECTION_NAME"
, "schemas":["SCHEMA_NAME"]
},
{
"connectString":"TNS_CONNECTION_NAME_2"
, "schemas":["SCHEMA_NAME_2"]
}
]
}
}
I could look into it, but I really haven't found where is the sql or sqlcl command built, any ideas where shoud I look at?
oradew-vscode/src/cli/common/base.ts
Line 167 in e1d29b9
Take a look here...
It seems that is working ok if you put user "" and password "" and you just execute as script, but if you compile code it tries to reuse the connection from a connection pool that requires environment and user to be non empty. I will need to make some changes, what do you think?
-
Modify validations and json definition to allow connectString to be optional at users level in dbconfig.json:
{
"ENVIRONMENT":{
"users":[
{
"user":"SCHEMA_NAME",
"connectString":"CONNECT_STRING",
}
]
}
} -
Make password non mandatory in dbconfig.json, so it stops asking for it if you specify connectString at users level.
-
When you specify connectString at users level, connect string will be /@connectString
I agree, it is perfectly fine with me.
I've seen that you participated in SQL Tools for oracle driver, but it is now deprecated as of version 0.23 because drivers are now separated extensions. Is there any special reason for it? Did you just not updated it or did you find some limitations?
Mainly I haven't found the time to update it, also It hadn't really suited my needs for fast data browsing that I needed. Maybe you can try version 0.22...
I will give a try to visual studio and official oracle extension as I think that it could solve all my needs. The visual studio code official extension is too basic right now.
please let me know if you find it satisfying.
I've tried it and it was really dissapointing, visual studio code is much faster and the extension for full visual studio has reallly serious bugs and performance issues
I still use SQL Developer for more data-related work (complicated SQLs, optimizactions, etc..), but oradew for PL/SQL development...