Embedded widget in Aspx

I am using a self hosted widget in aspx page. Since moved into the identity engine
1- added : useInteractionCodeFlow: true, (Require Signup)
after making these changes , the login is not working properly.

Initial appraoch : throws 401 error while trying to get the token
el: ‘#widget-container
}, function success(res) {
if (res.status === ‘SUCCESS’) {
console.log(‘Do something with this sessionToken’, res.session.token);
} else {

Hence instead initial approach for render , made changes like:

.catch(err => {
console.log('Error happen in showSignInAndRedirect: ', err);

in this approach its getting redirected but Token is not generated (Token is required for OWIN challenge)

There is no sessionToken when using useInteractionCodeFlow in Identity Engine, that’s part of the /authn pipeline from Okta Classic and will never be returned if you enable Interaction Code Flow.

I recommend reading through our guides about using this flow to log in on an Embedded Sign In Widget.


Thank you for your response.

I have an ASPX project . Hence the application on okta is configured as server side (Not SPA) .

I am getting the token if its configured as SPA. but currently i am getting token endpoint as unauthroized.

Is there a way to implement embedded login in ASPX application (identity engine)

Tried Approach :

I have tried using idx package and redeem token using interaction code . Since the idx context is null . this approach is not working.


This guide might be a good place to start: Load the Widget | Okta Developer


Thank you for response.

The Link shared is for .net MVC (My application is aspx webforms). I tried to implement the same using webforms but the idxcontext is null in webforms. idxcontext is required to redeem the code using interaction code. Hence unable to get the token.

Is there any sample app or link which uses self hosted login in aspx form ( identity engine)

The widget is rendered using javascript in aspx page. so do i need to configure the application in okta as SPA (client side) or web application.


The embedded widget guide I linked to is a self-hosted login example. The other option is this guide that uses the new idx SDKs.

You can find full built samples here: okta-idx-dotnet/samples/samples-aspnet at master · okta/okta-idx-dotnet · GitHub

Hi Andrea,

Thank you for your time in providing the solution.

I will elaborate my situation

Initially :

const signIn = new OktaSignIn({
    baseUrl: '@Configuration["Okta:OktaDomain"]',

signIn.renderEl({ el: '#widget' }, (res) => {
    var sessionTokenField = $("#hiddenSessionTokenField");
    var form = sessionTokenField.parent();
}, (err) => {

In this approach I am able to login successfully but the signup option is missing(enrollment is configured)
Since its moved into identity Engine I have added : useInteractionCodeFlow: true (as mentioned in doc) after adding useInteractionCodeFlow: true Signup appeared but the login fails (getting 401 in token endpoint).

Main Objective:

Is there a way to add Signup option in the initial approach (Identity Engine). If we add option : registration = true (deprecated) Signup option is enabled but error happens on loading registration form.


Are you getting a specific error back from the /token endpoint?