@@ -175,13 +175,17 @@ def _parse_form_from_html(self, html):
175
175
176
176
def _fill_in_form_values (self , config , form_data ):
177
177
username = config ['saml_username' ]
178
- username_field = set (self .USERNAME_FIELDS ).intersection (form_data .keys ())
178
+ username_field = set (self .USERNAME_FIELDS ).intersection (
179
+ form_data .keys ()
180
+ )
179
181
if not username_field :
180
182
raise SAMLError (
181
183
self ._ERROR_MISSING_FORM_FIELD % self .USERNAME_FIELDS )
182
- else :
183
- form_data [username_field .pop ()] = username
184
- password_field = set (self .PASSWORD_FIELDS ).intersection (form_data .keys ())
184
+ form_data [username_field .pop ()] = username
185
+
186
+ password_field = set (self .PASSWORD_FIELDS ).intersection (
187
+ form_data .keys ()
188
+ )
185
189
if password_field :
186
190
form_data [password_field .pop ()] = self ._password_prompter (
187
191
"Password: " )
@@ -252,17 +256,27 @@ def retrieve_saml_assertion(self, config):
252
256
return r
253
257
254
258
def is_suitable (self , config ):
255
- return (config .get ('saml_authentication_type' ) == 'form' and
256
- config .get ('saml_provider' ) == 'okta' )
259
+ return (
260
+ config .get ('saml_authentication_type' ) == 'form'
261
+ and config .get ('saml_provider' ) == 'okta'
262
+ )
257
263
258
264
259
265
class ADFSFormsBasedAuthenticator (GenericFormsBasedAuthenticator ):
260
- USERNAME_FIELDS = ('ctl00$ContentPlaceHolder1$UsernameTextBox' , 'UserName' ,)
261
- PASSWORD_FIELDS = ('ctl00$ContentPlaceHolder1$PasswordTextBox' , 'Password' ,)
266
+ USERNAME_FIELDS = (
267
+ 'ctl00$ContentPlaceHolder1$UsernameTextBox' ,
268
+ 'UserName' ,
269
+ )
270
+ PASSWORD_FIELDS = (
271
+ 'ctl00$ContentPlaceHolder1$PasswordTextBox' ,
272
+ 'Password' ,
273
+ )
262
274
263
275
def is_suitable (self , config ):
264
- return (config .get ('saml_authentication_type' ) == 'form' and
265
- config .get ('saml_provider' ) == 'adfs' )
276
+ return (
277
+ config .get ('saml_authentication_type' ) == 'form'
278
+ and config .get ('saml_provider' ) == 'adfs'
279
+ )
266
280
267
281
268
282
class FormParser (six .moves .html_parser .HTMLParser ):
0 commit comments