AUTHMECH=LDAP
Does the tdodbc driver or this SQLA Dialect support LDAP authentication to TD?
I scanned through the code quickly - I can't find anything that appears that it would allow setting the Logon Mechanism used.
@woel0007 ~~Short answer is the dialect doesn't support LDAP right now.~~ The tdodbc driver is from the python teradata library.
@woel0007 I may have spoken too soon. I've updated the dialect to handle extra parameters being passed in the connection string (see 129255b0100455b8a6f29044ad75cdcb4e8c3bad).
The tdodbc component from the Teradata Python Library does support LDAP. You have to pass "authentication=LDAP" to the UdaExec::connect function either as a method argument or via the data source definition in an external configuration file.
@escheie The connect arguments from the engine can be passed to the odbcConnect constructor (which is what is being used when the engine is created).
I'm not sure what processing is done for the authentication kwarg in UdaExec::connect but if all that needs to be done is to pass the authentication kwarg to odbcConnect, then you should be able to do it like so:
from sqlalchemy import create_engine
user = 'user'
pasw=user
host = 'host'
td_engine = create_engine('teradata://'+ user +':' + pasw + '@'+ host + '/' + '?authentication=LDAP')
print(td_engine)
Engine(teradata://user:***@host/?authentication=LDAP)
I'm not familiar with external authentication. Is there a way to verify if it worked?
No handling of the authentication parameter is done in UdaExec so you can pass it straight through to the OdbcConnection constructor. The key and value is added to the connect string that is passed to ODBC driver SQLDriverConnectW function. Sounds like it should work with no changes.
Sorry to comment on a closed issue, but can you pass in multiple parameters at a time? I'm trying to add LDAP authentication and also specify a driver but it seems I can only do one or the other.
teradata://user:@host/?authentication=LDAP/?driver=Teradata or teradata://user:@host/?authentication=LDAP?driver=Teradata
only seems to capture whichever parameter is entered first. I'm sure I'm missing something simple here.
Shouldn't you be using an ampersand (&) between parameters in the connection URL?
That does the trick! And just as I figured, it was incredibly simple. Appreciate the help!