Jump to content

Recommended Posts

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?

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

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>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...