Browser side code to get user details


I am using a third party tool call along with OKTA as the SSO I only have selected access to adjust the page in basic terms add a bit of html, css, javascript.

I dont have access to the server so cant write any PHP/CURL and seems OKTA blocks the use of CORS.

Now I can see contains the email address, so what I would like to do is from my page that they land on after loggin in via OKTA is to access this β€˜me’ and capture the email address in order to customize the experience.

Any help much appreciated

You can use an ajax call like this to get the session, then in the success just do with it as you please:

type: "GET",
accept: "application/json",
contentType: "application/json",
crossDomain: true,
xhrFields: {
    withCredentials: true
success: function (response) {
error: function (xhr, status, error) {


1 Like