Jump to content

getting tenant name on home page


pramodkrjsr

Recommended Posts

I want to print the tenant name with username on the home page. What to do?

I need something like below as getting tenantId

Option-1

Object principal = org.springframework.security.context.SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String tenantId = ((com.jaspersoft.jasperserver.api.metadata.user.domain.TenantQualified) principal).getTenantId();
 

Option-2

<authz:authentication property="principal.tenantId"/>

I am using jasperserver-pro-3.7.1

 

Thanks in advance

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Try inserting something like this:

<p>You belong to <%= ((com.jaspersoft.jasperserver.api.metadata.user.domain.impl.client.MetadataUserDetails)org.springframework.security.context.SecurityContextHolder.getContext().getAuthentication().getPrincipal()).getTenantId() %></p>

Does that get you want you need?

Regards,
Matt

Link to comment
Share on other sites

  • 4 years later...

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