Need to get customized redirection url

Hi, I have setup server https://dev-****.okta.com for my testing purpose so that first we can test our app to integrate with okta for SSO.
Reference for App Setup: GitHub - okta/samples-aspnet-webforms: Okta + ASP.NET Web Forms
I am using Okta widget and sdk for this. My application is ASP.NET Webforms based.
Now everything working fine, and In response to authcall ‘https://abc.xyz.com/emrsso//authorization-code/callback’, I am getting response code 302 which is fine and in response header location getting “location: /”. Which means now I will be redirect to home page of app in my case it is ‘https://abc.xyz.com’.
However I need to redirect to ‘https://abc.xyz.com/emrsso’.
Is there anyway I can get location as ‘/emrsso’ or is there any other way to achieve this.

Hello,

If you are running the Okta Web Forms sample (self hosted), in Login.aspx.cs you can do something like the below,

                var sessionToken = Request.Form["sessionToken"]?.ToString();
                var properties = new AuthenticationProperties();
                properties.Dictionary.Add("sessionToken", sessionToken);
                properties.RedirectUri = "/okta/about";

                HttpContext.Current.GetOwinContext().Authentication.Challenge(
                        properties,
                        OpenIdConnectAuthenticationDefaults.AuthenticationType);
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.