Recently, I integrated the Okta angular sign-in widget into my project, but I encountered an issue.
In my application, I have multiple modules including an authentication module that manages sign-in, sign-out, and sign-up functionalities.
The route I ultimately want to access is localhost:4200/api/upload
. To streamline things and keep all main routes within the authentication module, I added a redirection between localhost:4200/api/upload
and localhost:4200/sign-in
, with the path defined as
{path: 'signed-in-redirect', pathMatch : 'full', redirectTo: 'api/upload'}
.
Therefore, when I log in using Okta from the sign-in
page at localhost:4200/sign-in
, it should ideally redirect me to
localhost:4200/signed-in-redirect
and subsequently to the desired path localhost:4200/api/upload
. However, it seems to get stuck on the sign-in page instead of redirecting. The URL after signing in looks like this: http://localhost:4200/sign-in?redirectURL=%2Fapi%2Fupload%3Fcode%3DkDPYjQPbut93pUXc3BR_04w4Xf8rn3c3y2eQXGNyOSc%26state%3DqEpxhsyhv13ZqZo0YteWJkWTBdNKX29bqaYrjTZEjhZVI0rAhRDtxYh1ykOJG16o
Here's a snippet from the sign-in.ts
file:
// Your code goes here
In the sign-in.html
file:
// HTML code goes here
And in the appConfig.ts
:
// App configuration details go here
Finally, the app.routing.ts
includes routing information for different components and modules within the application.