Role Mapping

0

I have an external authentication service. I would like to use that service to authenticate users and use the roles returned. I got the login process working. I set up a role mapping. I have an Authentication object populated with roles. When I login, it looks like the roles aren't working. I can see using the admin (jasperadmin) the external roles. Why isn't my role mapping working?

 

Besides adding this, what else should I do?

    <bean id="mtExternalUserSetupProcessor" class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.processors.MTExternalUserSetupProcessor" parent="abstractExternalProcessor">

        <property name="userAuthorityService">
            <ref bean="${bean.internalUserAuthorityService}"/>
        </property>
        <property name="defaultInternalRoles">
            <list>
                <value>ROLE_USER</value>
            </list>
        </property>

        <property name="organizationRoleMap">
            <map>
                <entry>
                    <key>
                        <value>ROLE_EXTERNAL_ADMINISTRATOR</value>
                    </key>
                    <value>ROLE_ADMINISTRATOR</value>
                </entry>
            </map>
        </property>
    </bean>

 

The user I was testing with, it has a role of "ROLE_EXTERNAL_ADMINISTRATOR" and "EXTERNAL_ADMINISTRATOR". It seems jaspersoft prepends "ROLE_" to the role if it is missing.

 

What did I do wrong or what am I missing?

jleylegian's picture
Joined: Jun 1 2016 - 12:39pm
Last seen: 3 years 5 months ago

I'm trying to use the roles returned by my custom authentication method and map them to system and organizational roles in Jaspersoft. Thus far I haven't been able to get system roles to be mapped. Everything seems to be mapped to organziational roles.

I have this bean, but it doesn't seem to be enough for mapping to system roles.

 

<bean id="mtExternalUserSetupProcessor" class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.processors.MTExternalUserSetupProcessor" parent="abstractExternalProcessor">

        <property name="userAuthorityService">
            <ref bean="${bean.internalUserAuthorityService}"/>
        </property>
        <property name="defaultInternalRoles">
            <list>
                <value>ROLE_USER</value>
            </list>
        </property>

        <property name="organizationRoleMap">
            <map>
                <entry>
                    <key>
                        <value>ROLE_EXTERNAL_ADMINISTRATOR</value>
                    </key>
                    <value>ROLE_ADMINISTRATOR</value>
                </entry>
            </map>
        </property>
    </bean>

jleylegian - 3 years 5 months ago

1 Answer:

0

Am trying to understand what exactly do you want ??? Can you detail what are you trying to achieve

Jasper creates ROLE_ for every role you try to create

 

viki.panmand's picture
Joined: Oct 14 2015 - 3:39am
Last seen: 2 years 9 months ago
Feedback
randomness