Jump to content
We've recently updated our Privacy Statement, available here ×

Map Internal Role to an External Role with Token Based Authentication


Balraj
Go to solution Solved by Balraj,

Recommended Posts

Hi Community,

I'm implementing Token Based Authentication, when the user is trying to login with the token, he's successfully logging in but with a default role i.e., ROLE_USER. Whereas the user which i passed having Administrator privileges.

How to properly Map External Roles with Jasper Internal Roles at the organization level and root level?

This is what I've tried.

Here is my Token Format in JAVA: String plainText="u="+userid+"|r="+role+"|o="+orgid; where userid,role, orgid are variables.

Configuration of "applicationContext-externalAuth-preAuth-mt" file for Role Mapping:

<bean id="mtExternalUserSetupProcessor" class="com.jaspersoft.jasperserver.multipleTenancy.security.externalAuth.processors.MTExternalUserSetupProcessor" parent="abstractExternalProcessor">        <property name="userAuthorityService">            <ref bean="${bean.internalUserAuthorityService}"/>        </property>        <property name="organizationRoleMap">            <map>                <!-- Example of mapping customer roles to JRS roles -->                <entry key="ROLE_ADMIN" value="ROLE_ADMINISTRATOR" />                <!--<entry>                    <key>                        <value>ROLE_DADMIN</value>                    </key>                    <value>ROLE_ADMINISTRATOR</value>                </entry>    -->            </map>        </property>        <property name="defaultInternalRoles">            <list>                <value>ROLE_USER</value>            </list>        </property>        <property name="permittedRolesRegex">            <list>                <value>JRS_.*</value>                <value>EXT_.*</value>            </list>        </property>    </bean>[/code]

Guide me if i'm doing wrong.

Best Regards,

JasperExplorer

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

Hi All, I resolved it. we've to place "permittedRolesRegex" property in comments, in the XML File

<!--<property name="permittedRolesRegex">            <list>                <value>JRS_.*</value>                <value>EXT_.*</value>            </list>        </property>-->[/code]

Best Regards,

JasperExplorer

 

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...