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

Token based authnetication session - groovy security check


msiljegovicgmail.com

Recommended Posts

Hi all,

I'm using token based authentication to login to jasper server. In token I'm sending profile data (example: profAttrr1=234,456,211, profAttr2=897,209,546). 

I succesufully log in, I can see that profile data is assigned to user as super admin on other browser.

From other side, Im using security file on domain data, and checking(with groovy) if data in certain table columns contains 'ids' from profile attrributes values(profAttr1, proffAttr2).

groovy('authentication.getPrincipal() .getAttributes() .find{ it.attrName == "profileAttrib1" } .attrValue.split(",") .collect{"''" + it + "''"} .join(",") .replaceFirst("^''","") .replaceFirst("''$","")')

Problem is that when user first time log in into the system, and wants to create ad hoc view from created domain he got the following error  java.lang.NullPointerException: Cannot get property 'attrValue' on null object. It means that groovy cannot see data in profile attributes during the first log in! If I logout and then login same user again, everything works fine, probably beacuse there is already some profile data for user.

It seems that problem is with session that is opened with token authentication? Anyone can explain this?

Thanks in advance

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

We had a security file doing a similar thing for version 5.5.  We are working on upgrading to 6.2 and I have seen the same issue.  The following appears to work for 6.2:

groovy('attributesService.getAttribute(*YOURATTRNAME*,null).attrValue')

I got this from http://community.jaspersoft.com/documentation/tibco-jasperreports-server-security-guide/v62/creating-domain-security-file

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