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

Add user/pass Login Disclaimer Support #204

Open
wants to merge 1 commit into
base: fos_v6.0.0/galaxy_2.1.7
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion plugins/httpapi/fortios.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ def login(self, username, password):
data = "username=" + urllib.parse.quote(username) + "&secretkey=" + urllib.parse.quote(password) + "&ajax=1"
dummy, result_data = self.send_request(url='/logincheck', data=data, method='POST')
self.log('login with user: %s %s' % (username, 'succeeds' if result_data[0] == '1' else 'fails'))
if result_data[0] != '1':
if result_data[0] == '1' and "logindisclaimer" in result_data:
dummy, result_data = self.send_request(url='/logindisclaimer', data="confirm=1", method='POST')
if "document.location" not in result_data:
raise Exception('Unable to accept Login Disclaimer. Please check')
elif result_data[0] != '1':
raise Exception('Wrong credentials. Please check')
# If we succeed to login, we retrieve the system status first
else:
Expand Down