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

SSO on different site support #423

Closed
lanphan opened this issue May 28, 2016 · 2 comments
Closed

SSO on different site support #423

lanphan opened this issue May 28, 2016 · 2 comments

Comments

@lanphan
Copy link

lanphan commented May 28, 2016

Dear all,

I'd like to ask that can we use Locust to support sending request to 2 different hosts in the same task? Because we have SSO site separately, we need to have 2 requests in 1 task:

  • send request to SSO site to get token (POST)
  • based on that token to authenticate and request the main site (GET or POST)

I did use Locust to load testing 1 simple site quite easily, but for this case, I'm struggling ...

@heyman
Copy link
Member

heyman commented May 30, 2016

Hi!

You can make a request to a host other than the default one, simply by specifying the full URL. Something like this:

response = self.client.post("http://my-sso.host.com/login")
token = get_token_from_response(response)
self.client.post("/auth", {"token": token})

@heyman heyman closed this as completed May 30, 2016
@murhnde
Copy link

murhnde commented Jan 23, 2019

Dear all,

I'd like to ask that can we use Locust to support sending request to 2 different hosts in the same task? Because we have SSO site separately, we need to have 2 requests in 1 task:

  • send request to SSO site to get token (POST)
  • based on that token to authenticate and request the main site (GET or POST)

I did use Locust to load testing 1 simple site quite easily, but for this case, I'm struggling ...

Hi!

You can make a request to a host other than the default one, simply by specifying the full URL. Something like this:

response = self.client.post("http://my-sso.host.com/login")
token = get_token_from_response(response)
self.client.post("/auth", {"token": token})

@lanphan Were you able to do it? I have the same task now. I have to open a website 'https://xxx.com'. It will use okta and automatically login with my credentials and then display all the applications I have access to. Then I have to select the application I need to test by clicking on the hyperlink which inturn redirects to another url https://yyy.com. Kindly let me know how you managed to automate this whole process using locust.

@heyman I tried your process, but I am getting error message "SSLError(MaxRetryError('HTTPSConnectionPool(host='xxx.com', port=11111): Max retries exceeded with url: /enterpriseLogin (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))',),). Please let me know if I am doing something wrong here.

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