File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
src/main/java/com/okta/tools/io Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 88import java .net .URL ;
99import java .net .URLConnection ;
1010import java .util .Arrays ;
11+ import java .util .List ;
1112import java .util .function .BiFunction ;
1213import java .util .logging .Logger ;
1314
@@ -24,12 +25,18 @@ final class LoginPageInterceptingProtocolHandler extends sun.net.www.protocol.ht
2425 @ Override
2526 protected URLConnection openConnection (URL url , Proxy proxy ) throws IOException {
2627 URLConnection urlConnection = super .openConnection (url , proxy );
27- if (environment .oktaOrg .equals (url .getHost ()) &&
28- Arrays .asList (
29- URI .create (environment .oktaAwsAppUrl ).getPath (),
30- "/login/login.htm" ,
31- "/auth/services/devicefingerprint"
32- ).contains (url .getPath ())
28+ URI oktaAwsAppUri = URI .create (environment .oktaAwsAppUrl );
29+ List <String > domainsToIntercept = Arrays .asList (
30+ environment .oktaOrg ,
31+ oktaAwsAppUri .getHost ()
32+ );
33+ List <String > requestPathsToIntercept = Arrays .asList (
34+ oktaAwsAppUri .getPath (),
35+ "/login/login.htm" ,
36+ "/auth/services/devicefingerprint"
37+ );
38+ if (domainsToIntercept .contains (url .getHost ()) &&
39+ requestPathsToIntercept .contains (url .getPath ())
3340 ) {
3441 LOGGER .finest (() -> String .format ("[%s] Using filtering URLConnection" , url ));
3542 return filteringUrlConnectionFactory .apply (url , urlConnection );
You can’t perform that action at this time.
0 commit comments