-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connect to PI server using credentials #511
Comments
Currently this isn't supported in the python API, and I think I cannot test it locally. Would you be able to test it if I added it to the code? |
Sure, I can test it against several PI servers with different
configurations / environments.
Just tell me what to do.
Thank you,
Regards
|
Can you install the test version using You should then be able to connect to the PI Data Archive using something like the following: import PIconnect as PI
from PIconnect.PIConsts import AuthenticationMode
with PI.PIServer(username='...', password='...', authentication_mode=AuthenticationMode.PI_USER_AUTHENTICATION) as server:
points = server.search('*')
print(len(points)) Note that it's required to provide both a username and password (no default username). If you need to provide a login domain you can use the argument If you experience any issues please let me know! |
Thank you! Here's my results. SecureString object seems not to be working: I get PIAuthenticationException. Something seems wrong because if I print the SecurePassword.Length I get 0, so I guess no password is being passed to the server:
Instead, if I replace the SecureString with just a String:
the connection is successful (I added some print to the |
This works with SecureString:
I guess a SecureString in .NET cannot be constructed from a string, but must be built char by char... |
Thanks for testing! I will fix the |
I pushed a new version that incorporates the correct construction of the |
It works great! I tested with both I believe the issue is solved and can be committed to master, if you agree this can be closed. Thank you again, |
Great to hear that! I will include it in the development release for now, it will trickle into master in the next release. |
thanks for adding this new function. Just wonder when the new release with this function will come out. And if not soon, is the test version still available? thanks. |
Thank you for fixing that, is the new release coming soon? I am getting the same issue and I would like to use AuthenticationMode.WINDOWS_AUTHENTICATION to my script. |
you can always install from the github development branch, but I'll try to make a new release soon. To install the latest developments you can install using: |
Hello, is it possible to connect to PI database over VPN? I receive PIAuthenticationException when trying to connect to pi database. The PIconnect version is 0.9.1, with the updated secure string. Thank you, |
Can you connect using official PI software over that VPN? If the SDK supports it, it should be possible using |
Hi, I didn't get how to explicitly pass username and password when connecting to a specific PI server. In my environment I need to provide a technical user to connect to the server instead of using my own Windows credentials.
The text was updated successfully, but these errors were encountered: