Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Block Basic Auth on Exchange 2016

Martin_Aigner
Nimbostratus
Nimbostratus

As we migrated to Modern Auth (OAuth) we'd like to retire legacy authentication protocols on our external interfaces for Exchange

We have a separate iApp for the external traffic where we included an iRule to block Basic Auth requests (this works)

The same rule should also remove the www-authenticate header on responses for supporting Basic in case this is offered by the server after a 401.

 

As this triggers this accidently removes all headers and not only the one containing 'Basic' in the example below

 

Hoping somebody here has done anything similar already in the past?

 

when HTTP_REQUEST {

   if { [string tolower [HTTP::header values "Authorization"]] contains "basic"} {

       drop

   }

}

when HTTP_RESPONSE {

   if {[HTTP::status] == 401} {

  foreach header_name [HTTP::header names] {

      if { [string tolower [HTTP::header value $header_name]] contains "basic"} {

         HTTP::header remove $header_name}

        }

   }

}

0 REPLIES 0