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>
Guide me if i'm doing wrong.
Best Regards,
JasperExplorer