Menu not loaded in docker deployment

I would like to run privacyidea in a docker container. I know this is not supported method of installation but I thought it would be worth a try. I have posted info in this ticket first, you can see the Dockerfile and etc.

The problem I have is that menu items are not loading. I did a bit of digging, enabling some console.log() messages in browser console. I suspect that authentication mechanism is not passing info to the browser.

My guess. In menu.html file template in this line privacyidea/menu.html at master · privacyidea/privacyidea · GitHub
This code:

                <li ui-sref-active="active"
                    ng-show="loggedInUser.role == 'admin' && checkMainMenu('config')">
                    <a ui-sref="config.system">
                        <span class="glyphicon glyphicon-cog"
                              aria-hidden="true"></span>
                        <translate>Config</translate>
                    </a>
                </li>

Angular will try to evaluate variables and if true, then will show this item.I have uncommented some debug logs in file
static/components/login/controllers/loginControllers.js
This line console.log($scope.loggedInUser);
and this is logged in browser console

{    "username": "adfoajfasfasfd",
    "realm": "",
    "auth_token": "trr3i2otJEnTGSA",
    "role": "admin",
    "rights": [],
    "menus": []
}

In another installation somewhere else done with virtualenv, I get 6 items in menus list and a lot of items in rights list as well.

As this is not currently supported method of deployment I am at least hoping for advice how to debug, where to start.

Thank you.

Welcome to privacyIDEA, @invizus.

This is most probably not related to your installation but your configuration.

Check your admin policies and re-read the chapter about admin policie in the docs.
https://privacyidea.readthedocs.io/en/master/policies/admin.html

You funnily named admin probably has no rights.

Otherwise, which information do you think others might need to investigate your problem?

Thank you. I have tried adding policies found in your github, after fiddling with JSON (it was missing "policy": [] key in superuser.json policy), I am still unable to view the menu in web ui. Sometimes I even get errors in UI like:

Admin actions are defined, but the action caconnectorread is not allowed!

Maybe the policies are out of date in the github, I think.

I am confused in the documentation as well, should not admin permissions work out of the box? Following this step after install:
https://privacyidea.readthedocs.io/en/master/firststeps/login.html

My admin user is created with pi-manage admin add.

I have also read this 16.3. So what’s the thing with all the admins? — privacyIDEA 3.9 documentation
but I cannot understand how to assign admin user created with pi-manage admin to the realm.

Maybe it is worth for me to restart the installation from scratch, maybe have I missed some steps.

Ok reinstalling from scratch helped. Thank you.

If no admin policy at all is defined each admin will have all rights.
If you define the first admin policy, policies will be checked for all admins, which probably will result in certain admins with no rights (and no menus)

Maybe it is not clear enough in the docs?

https://privacyidea.readthedocs.io/en/master/policies/admin.html

Hi Invizus, will you be releasing your docker container for general use once its working… :slight_smile:

Cossy

Sure, you can just use my code from github issue link but I do not mind putting up a repository in github, once I finished with testing it.