Skip to content
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

Windows Authentication support? #595

Closed
jakeam opened this issue Jun 3, 2017 · 3 comments
Closed

Windows Authentication support? #595

jakeam opened this issue Jun 3, 2017 · 3 comments

Comments

@jakeam
Copy link

jakeam commented Jun 3, 2017

My application is built in ASP.Net and uses Windows authentication, does Locust support this? I can't find any documentation on how to achieve this.

@cgoldberg
Copy link
Member

something like this should work:
https://github.com/requests/requests-ntlm

@jakeam
Copy link
Author

jakeam commented Jun 10, 2017

Perfect thank you!

@jakeam jakeam closed this as completed Jun 10, 2017
aldenpeterson-wf added a commit to aldenpeterson-wf/locust that referenced this issue Jun 26, 2017
@LeoPiero
Copy link

Sample solution based on examples in documentation:

from requests_ntlm import HttpNtlmAuth
from locust import HttpLocust, TaskSet, task

class UserBehavior(TaskSet):
	def on_start(self):
		""" on_start is called when a Locust start before any task is scheduled """
		self.login()
	#end on_start

	def login(self):
		"""use NTLM authentication"""	
		self.client.auth = HttpNtlmAuth('domain\\username','password')
		self.client.get("/")
	#end login

	@task(1)
	def index(self):
		self.client.get("/")
	#end index
#end UserBehavior

class WebsiteUser(HttpLocust):
	task_set = UserBehavior
	min_wait = 5000
	max_wait = 9000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants