Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get username
#1
Hi!
I have Flask app with CherryPy webserver. I need to do authentication using Active Directory. I can get user data from Active Directory but dont know how to get username(windows) from the user who launched my webapp. Are there any ways to get current user name(windows login)?
Reply
#2
The module os can help you.

deadeye@nexus ~ $ import os                                   
deadeye@nexus ~ $ os.getuid()                                 
1000
deadeye@nexus ~ $ os.getlogin()                               
'deadeye'
deadeye@nexus ~ $
Don't worry, it's not inside a Python REPL, it's XONSH.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#3
Module os and getpass do not work as I need.
when I use the specified module(os or getpass), it always returns the data of a user authorized on the server where my application is installed. I would like to receive the data of the user who opened my application on his computer in a browser
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Saving username as first name while adding user in django admin prithvi 0 4,354 Aug-10-2017, 06:50 PM
Last Post: prithvi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020