r-lib / keyring

:closed_lock_with_key: Access the system credential store from R
https://keyring.r-lib.org/
Other
196 stars 28 forks source link

Having @ in user name throws an error #71

Closed alexhallam closed 3 years ago

alexhallam commented 5 years ago

We switched to using our active directory email and password for sql server login.

If I set key_set("uid") as name@mycompanyname.com Then try to use it in connecting to a database I get an error

Cannot open server "mycompanyname.com" requested by the login. The login failed.

but when I return just key_get("uid") name@mycompanyname.com

I am guessing the @ is messing up the parsing somewhere.

The code used to connect to the database is

con <- DBI::dbConnect(odbc::odbc(), Driver = "ODBC Driver 17 for SQL Server", 
Server = "myserver.database.windows.net", 
Database = "mydb", UID = key_get("uid"), PWD = key_get("pwd"))
gaborcsardi commented 5 years ago

Which backend do you use?

alexhallam commented 5 years ago

I am on an Ubuntu Linux so I am guessing backend_secret_service.

gaborcsardi commented 3 years ago

@ is not treated specially by keyring AFAICT. That error message is from the database server I think. Maybe it interprets email addresses differently?

In any case, I don't think this is a keyring issue. If you disagree please reopen it. Thanks!