Report this

What is the reason for this report?

SSO Authentication for javascript applications

Posted on March 30, 2017

We have authentication server, there we provide the user credentials, once authenticated, the request forwarded to javascript application url. The request contains the user details. In javascript application, how can we read the user details from the request object.

Authentication Server: http://<authentication_server>/jetappcontext it takes to login page when no user loggged-in, once login success, it adds user details to the request object and forward to the javascript app url http://<javascript_app_server>/jappcontext/index.html

Please do suggest how can achieve this ?

Apart from the above, if you have already implemented any solution for SSO with oracle jet application, please provide the details.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello all,

In case anyone stumbles on the question, I belive this could be of some help. To read user details from the request object in a JavaScript application, you can use the following steps:

  1. In your JavaScript application, you can use the window.location.search property to get the query parameters from the URL. For example, if your URL is http://<javascript_app_server>/jappcontext/index.html?user_id=123&username=john, you can get the query parameters by calling window.location.search.

  2. Once you have the query parameters, you can parse them using a URLSearchParams object. For example:

const urlParams = new URLSearchParams(window.location.search);
const userId = urlParams.get('user_id');
const username = urlParams.get('username');

In this example, we create a new URLSearchParams object using the query string from the URL, and then use the get() method to retrieve the values of the user_id and username parameters.

  1. You can then use the retrieved user details in your JavaScript application as needed.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.