Signed in/Logged in Information of the user in Azure APIm Developer Portal

599 views Asked by At

We added a new page/tab xyz like Products on developer portal using content menu item. I want to throw error message on that page if the user navigates on that page if he is not logged in asking him to log in.

Is there a way to find the information of the user who is logged in or to verify if some one has logged in or not.

There is one html element or anchor tag through we can find the username of logged in user but that element do not exist when user is not logged in.

3

There are 3 answers

1
VinuBibin On BEST ANSWER

if it is static page and you are writng the code in developer portal, you can add a script to check the session cookie which is there or not. Hence you can show authroised and unauthorised.

Also there is another way, only while login the account menu will be displayed. so you can check with that as well.

  var accountMenu = document.getElementById("account-menu");
   if(accountMenu == null) {
       // not logged in
    } else {
        // logged in   
   }

1
Alex On

Not sure if that fully covers your scenario, but you can try to play with Widgets and Layers:

Layer editor

Basically, you can create a layer with a rule "authenticated" or "not authenticated" to show/hide it and add respective widget to that layer.

0
Agni On

I too need this feature in Developer portal, Someone has already submitted an idea for the same.

https://feedback.azure.com/forums/248703-api-management/suggestions/18695476-add-the-ability-to-disable-features-of-the-develop