@@ -27,6 +27,19 @@ public void ConfigValidatorPassesWhenValid()
2727 new OktaConfig ( "testoktaid" , "https://okta.okta.com" , "appid:/redirect" , "appid:/logout" )
2828 { ClockSkew = TimeSpan . FromSeconds ( 100 ) , Scope = "test1 test2" } ) ;
2929
30+ // Test new TLD support
31+ validator . Validate (
32+ new OktaConfig ( "testoktaid" , "https://dev-00000.trex-govcloud.com" , "com.test:/redirect" , "com.test:/logout" ) ) ;
33+
34+ validator . Validate (
35+ new OktaConfig ( "testoktaid" , "https://dev-00000.okta-gov.com" , "com.test:/redirect" , "com.test:/logout" ) ) ;
36+
37+ validator . Validate (
38+ new OktaConfig ( "testoktaid" , "https://dev-00000.okta.mil" , "com.test:/redirect" , "com.test:/logout" ) ) ;
39+
40+ validator . Validate (
41+ new OktaConfig ( "testoktaid" , "https://dev-00000.okta-miltest.com" , "com.test:/redirect" , "com.test:/logout" ) ) ;
42+
3043 // The validator throws an exception when the config is invalid, so if we got here without an exception then the configs are valid.
3144 }
3245
@@ -67,6 +80,19 @@ public void ConfigValidatorCatchesInvalidDomain()
6780 Assert . Throws < ArgumentException > ( ( ) =>
6881 validator . Validate ( new OktaConfig ( "testoktaid" , "https://dev-00000-admin.oktapreview.com" , "com.test:/redirect" , "com.test:/logout" ) ) ) ;
6982
83+ // Test that admin domains are caught for new TLDs
84+ Assert . Throws < ArgumentException > ( ( ) =>
85+ validator . Validate ( new OktaConfig ( "testoktaid" , "https://dev-00000-admin.trex-govcloud.com" , "com.test:/redirect" , "com.test:/logout" ) ) ) ;
86+
87+ Assert . Throws < ArgumentException > ( ( ) =>
88+ validator . Validate ( new OktaConfig ( "testoktaid" , "https://dev-00000-admin.okta-gov.com" , "com.test:/redirect" , "com.test:/logout" ) ) ) ;
89+
90+ Assert . Throws < ArgumentException > ( ( ) =>
91+ validator . Validate ( new OktaConfig ( "testoktaid" , "https://dev-00000-admin.okta.mil" , "com.test:/redirect" , "com.test:/logout" ) ) ) ;
92+
93+ Assert . Throws < ArgumentException > ( ( ) =>
94+ validator . Validate ( new OktaConfig ( "testoktaid" , "https://dev-00000-admin.okta-miltest.com" , "com.test:/redirect" , "com.test:/logout" ) ) ) ;
95+
7096 Assert . Throws < ArgumentException > ( ( ) =>
7197 validator . Validate ( new OktaConfig ( "testoktaid" , "https://{yourOktaDomain}" , "com.test:/redirect" , "com.test:/logout" ) ) ) ;
7298
0 commit comments