예제 #1
0
 public void TestSsoTokenUrlMismatch()
 {
     try
     {
         var restRequester = new Mock.MockOktaRestRequester()
         {
             TokenUrl = "https://snowflakecomputing.okta1.com/api/v1/sessions?additionalFields=cookieToken",
             SSOUrl   = "https://snowflakecomputing.okta.com/app/snowflake_testaccountdev_1/blah/sso/saml",
         };
         var sfSession = new SFSession("account=test;user=test;password=test;authenticator=https://snowflake.okta.com", null, restRequester);
         sfSession.Open();
         Assert.Fail("Should not pass");
     } catch (SnowflakeDbException e)
     {
         Assert.AreEqual(SFError.IDP_SSO_TOKEN_URL_MISMATCH.GetAttribute <SFErrorAttr>().errorCode, e.ErrorCode);
     }
 }
예제 #2
0
 public void TestWrongPostbackUrl()
 {
     try
     {
         var restRequester = new Mock.MockOktaRestRequester()
         {
             TokenUrl        = "https://snowflakecomputing.okta.com/api/v1/sessions?additionalFields=cookieToken",
             SSOUrl          = "https://snowflakecomputing.okta.com/app/snowflake_testaccountdev_1/blah/sso/saml",
             ResponseContent = wrongPostbackContent,
         };
         var sfSession = new SFSession("account=test;user=test;password=test;authenticator=https://snowflakecomputing.okta.com;host=test", null, restRequester);
         sfSession.Open();
         Assert.Fail("Should not pass");
     } catch (SnowflakeDbException e)
     {
         Assert.AreEqual(SFError.IDP_SAML_POSTBACK_INVALID.GetAttribute <SFErrorAttr>().errorCode, e.ErrorCode);
     }
 }