Answer the question
In order to leave comments, you need to log in
How to authorize on a site with a dropdown list (domain) using request?
There is a servicedesk website
There is a working script for local authorization
s = requests.Session()
url = 'https://~.ru/j_security_check'
s.get(url)
data = dict(j_username='test', j_password='test')
s.post(url, data=data)
j_username=test&j_password=test&domain=Local+Authentication&LDAPEnable=false&hidden=Select+a+Domain&hidden=For+Domain&AdEnable=true&DomainCount=0&LocalAuth=No&LocalAuthWithDomain=No&dynamicUserAddition_status=true&localAuthEnable=true&logonDomainName=Local+Authentication&loginButton=
AUTHRULE_NAME=SDRelationalLoginModule&j_username=user&j_password=userpass&domain=3&DOMAIN_NAME=DOMEN&LDAPEnable=false&hidden=Select+a+Domain&hidden=For+Domain&AdEnable=true&DomainCount=0&LocalAuth=No&LocalAuthWithDomain=DOMEN&dynamicUserAddition_status=true&localAuthEnable=true&logonDomainName=DOMEN&loginButton=
s = requests.Session()
url = 'https://~.ru/j_security_check'
s.get(url)
data = dict(j_username='user', j_password='userpass', domain='3', DOMAIN_NAME='DOMEN',
LocalAuthWithDomain='DOMEN', logonDomainName='DOMEN')
s.post(url, data=data)
<span id="domainListSelect" style="display:block;">
<select name="domain" class="form-control" onchange='checkLocalAuth(this)'>
<option>-- Choose Domain --</option>
<option value="1"> DOMEN1 </option> <!-- NO OUTPUTENCODING -->
<option value="2"> DOMEN2 </option> <!-- NO OUTPUTENCODING -->
<option value="3"> DOMEN</option> <!-- NO OUTPUTENCODING -->
<option value='Local Authentication'>Local Authentication</option>
</select>
</span>
Answer the question
In order to leave comments, you need to log in
Well, in general, you can use selenium, but it is detected in many places, so it may not help :)
Pass the desired value from option - "1", "2", "3" or 'Local Authentication'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question