import win32security from typing import Optional from fastapi import Body, FastAPI from pydantic import BaseModel, Field from uvicorn import run app = FastAPI() def login_windows_func(user_name:str,password:str): try: token = win32security.LogonUser( user_name, 'ZAMAZINGODOM', password, win32security.LOGON32_LOGON_NETWORK, win32security.LOGON32_PROVIDER_DEFAULT) authenticated = bool(token) return authenticated except Exception as e: print (str(e)) return False class LoginForm(BaseModel): username: …
Devamını Oku »