public void CreateSessionRedirectUrl()
        {
            String fakeEndpoint = "http://validurl.com:9999";
            String fakeSessionToken = "FakeSessionToken";
            String fakeRedirect = "https://this.is.fake:42/really?really=true&also=very+true";

            // Create a SessionsClient
            OktaSettings oktaSettings = new OktaSettings();
            oktaSettings.BaseUri = new Uri(fakeEndpoint);
            oktaSettings.ApiToken = "fakeApiToken";
            SessionsClient sessionsClient = new SessionsClient(oktaSettings);

            // Crate the session url string
            String sessionUrlString = sessionsClient.CreateSessionUrlString(fakeSessionToken, new Uri(fakeRedirect));

            // Check the format
            Assert.AreEqual("http://validurl.com:9999/login/sessionCookieRedirect?token=FakeSessionToken&redirectUrl=https%3A%2F%2Fthis.is.fake%3A42%2Freally%3Freally%3Dtrue%26also%3Dvery%2Btrue", sessionUrlString);
        }
Example #2
0
        public void CreateSessionRedirectUrl()
        {
            String fakeEndpoint     = "http://validurl.com:9999";
            String fakeSessionToken = "FakeSessionToken";
            String fakeRedirect     = "https://this.is.fake:42/really?really=true&also=very+true";

            // Create a SessionsClient
            OktaSettings oktaSettings = new OktaSettings();

            oktaSettings.BaseUri  = new Uri(fakeEndpoint);
            oktaSettings.ApiToken = "fakeApiToken";
            SessionsClient sessionsClient = new SessionsClient(oktaSettings);

            // Crate the session url string
            String sessionUrlString = sessionsClient.CreateSessionUrlString(fakeSessionToken, new Uri(fakeRedirect));

            // Check the format
            Assert.AreEqual("http://validurl.com:9999/login/sessionCookieRedirect?token=FakeSessionToken&redirectUrl=https%3A%2F%2Fthis.is.fake%3A42%2Freally%3Freally%3Dtrue%26also%3Dvery%2Btrue", sessionUrlString);
        }