-
Notifications
You must be signed in to change notification settings - Fork 31
How can I use LDAP authentication? #52
Comments
I am facing to the same problem as Esfahan above…. |
What is the expected behavior here? You are able to use |
@ChrisRx Which keyname should I set? or How to set LDAP credentials?
And I can't find it in documnet written about LDAP, LOGMECH, LOGON_MECH. |
Oh ok I think I understand now, my apologies. You are needing support for a different logon mechanism. Currently, giraffez only supports the TD2 logon mechanism (Teradata's default), but I believe LDAP in particular could be added fairly easy. The biggest hurdle here is that I don't have a good way (that I know of) to test the change since I do not have access to a Teradata environment that is setup with LDAP integration. A possibility could be that I make the change in a branch and one of you would be able to validate if it works or not by compiling that particular branch and testing. Thoughts? |
Hello ChrisRx, Thank you for your answer. BTW: I can see there an ambiguity. The manual for TPT mentioned 'LogonMech' but for different clients is used 'logmech' for example: "jdbc:teradata://tdtest.kb.cz/logmech=LDAP,database=MyDatabaseName,tmode=TERA,charset=UTF16" I think I can help you to test yours improvements. I am not sure if I am able to compile (C - source code) but I can try it (after 30year) :-). Best regards |
I have an access to Teradata environment, so I can help you to test your improvements too. And I'm not sure if I am able to compile C, but I can try it too :-) Thanks |
What platforms are you both on? Installing from source should be fairly straight forward depending on what your platform is (Windows, Linux, etc), and would be similar to the instructions found here but what checking out a test branch before running the install. On Windows, it is a bit challenging because the Windows compiler is gated by obscurity, bloated applications, and/or expensive software (vs. Linux/macOS where it is freely available). For example, to support building wheels for Windows I had to save links to their old compilers that are no longer published on their download site (and are required for older versions of Python). The reason I am unable to test this functionality myself is that the Teradata server I have access to uses TD2 as a logon mechanism and it appears to properly test a different logon mechanism like LDAP the Teradata server itself needs to be configured to use that mechanism. Regardless, I'm sure we can figure something out and get this feature supported, just let me know what platform you are on and I will push the local test branch I have. |
Hello ChrisRx, Thank you for your explanation. Best regards |
Hey ChrisRx, Any updates with getting getting this functionality tested and implemented? I was able to connect using TD2 as our system account uses this logon mechanism, but local accounts are restrained to using LDAP to authenticate. I am currently running windows 10. |
I'm going to try and work this stuff into a branch to try out. Ironically, I no longer have access to a Teradata server to develop or test things, and will have to figure something out in order to actually test this kind of functionality. I will still try and get this into a branch though so that others can potentially try it out in the meantime. |
Thanks Chris, snprintf(conn->dbc->logmech_name, sizeof(conn->dbc->logmech_name), "LDAP "); Alas I am unfortunately not too familiar with C |
Turns out my change was working, I just didn't realize there was a separate Teradata API (Parellel Transporter) for the bulkload functionality. I add the following to _teradataptmodule.cc and it is now connecting through ldap using the Cmd or Bulkexport functions: self->conn->AddAttribute(TD_LOGON_MECH, "LDAP "); I guess the next step would be figuring out how to expose this to the front-end function through an optional parameter. Daniel |
Daniel, That is exactly what I believe needs to be added. I had started working up a feature addition on another branch and I feel it may finally be in a place where it could be considered to be merged. If you are able to take a look at it, let me know if you are able to connect with alternative connection mechanisms like LDAP. The way it works is setting |
Hey Chris, Sorry for the delayed response, I should be able to test your proposed changes. Which branch do I need to pull? |
I switched to the ext-cleanup branch to attempt to test the changes. When trying to run the setup.py to install, I received the following error: error: command '[...]\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2 Not sure if this is an issue on my side, but I can still compile from the source when on the master branch or my own branch. I am running Windows 10 with Python 2.7.15. I did notice you made some fixes for python 3.7, not sure if that would've impacted the windows/python2.7 install. Daniel |
Good news, I switched to python 3 and re-downloaded the Visual C++ and was able to compile the ext-cleanup branch. I tried switching the logon mech by running "giraffez config --set connections.mydb1.logon_mech LDAP" and getting the following error: BADLOGMECH(507): Requested logon mechanism is not available. Upon inspecting the teradata.c module, I believe you can change the following to get it to work: snprintf(conn->dbc->logmech_name, sizeof(conn->dbc->logmech_name), "%-*s", Since Teradata expects the logmech_name to be exactly 8 characters including spaces, you do not need to subtract the size of the logmech name and can instead just always pad to 8. This change appears to be working for both TD2 and LDAP |
looking for LDAP connect. install log -- begin-- Installed c:\python3\lib\site-packages\giraffez-2.1.0-py3.7-win-amd64.egg Using c:\python3\lib\site-packages\pycrypto-2.6.1-py3.7-win-amd64.egg Using c:\python3\lib\site-packages but ran 'giraffez config --list' gave below error: Traceback (most recent call last): I am using Python 3.7 on windows 7. |
issue resolved, by changed 'pycrypto' to 'pycryptodome': |
works now by modify teradata.c !! modify
thank you all! |
After messing with this a bunch, I got this to work, but I had to pad the logon_mech so that it was 8 characters long:
|
I want LDAP authentication to connect to Teradata with giraffez.
Is such a functionality available with giraffez?
What parameters should be specified to use LDAP with
giraffez config --set
command?Thank you
The text was updated successfully, but these errors were encountered: