cancel
Showing results for 
Search instead for 
Did you mean: 

Silent Logon to Infoview

Former Member
0 Kudos

We want to provide an external access to infoview thru external custom applications in Java. As of now we have an AD authentication to BOE. Please let me know what are the options and if possible pass on the sample code used.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I think that you mean to log in the infoview from a java application, in order to get some information (reports etc.) from the Infoview:

You can find this information on SDK java samples

Example (logonform.jsp)

//Retrieve the ISessionMgr object to perform the logon

ISessionMgr oSessionMgr = CrystalEnterprise.getSessionMgr();

//Logon to Enterprise (here you provide the username, password, cms and the type of authentication

IEnterpriseSession oEnterpriseSession = oSessionMgr.logon(logonForm.username, logonForm.password, logonForm.cmsname, logonForm.authType);

//Retrieve the InfoStore object from the Enterprise Session

IInfoStore oInfoStore = (IInfoStore)oEnterpriseSession.getService("", "InfoStore");

//Place the InfoStore object in session so it can be used in other pages

session.setAttribute("InfoStore", oInfoStore);

//Forward to the next page that displays a list of all the categories

response.sendRedirect("inside_infoview.jsp"); // After you login.. you can get information form infoview.

Former Member
0 Kudos

How do you expire or close the session after retrieving the report?

Former Member
0 Kudos

IEnterpriseSession oEnterpriseSession

oEnterpriseSession.logoff();

regis_korsakissok
Discoverer
0 Kudos

I have tried the jsp code to be logged to Infoview and it works well on BO XI 3.1.<br>

However , i want that it redirects to the main page of Infoview and it doesnt work.<br>

It goes back to the login form and provides the common.error.no.valid.session "Connection refused : Your session is not valid or is expired"<br>

<br>

How can i make it work?<br>

<br>

Thanks for any idea!<br>

<br>

String cms = "cmsvalue";<br>

String username = "username";<br>

String password = "password";<br>

String auth = "secLDAP";<br>

<br>

<br>

IEnterpriseSession enterpriseSession = null;<br>

Exception failure = null;<br>

boolean loggedIn = true;<br>

<br>

// If no session already exists, logon using the specified parameters.<br>

<br>

if (enterpriseSession == null)<br>

{<br>

try<br>

{<br>

// Attempt logon. Create an Enterprise session<br>

// manager object.<br>

ISessionMgr sm = CrystalEnterprise.getSessionMgr();<br>

<br>

// Log on to BusinessObjects Enterprise<br>

enterpriseSession = sm.logon(username, password, cms, auth);<br>

<br>

}<br>

catch (Exception error)<br>

{<br>

loggedIn = false;<br>

failure = error;<br>

}<br>

if (!loggedIn)<br>

{<br>

// If the login failed, redirect the user to the start page.<br>

return;<br>

}<br>

}<br>

else<br>

{<br>

// Store the IEnterpriseSession object in the session.<br>

session.setAttribute("EnterpriseSession", enterpriseSession);<br>

<br>

// Create the IInfoStore object.<br>

IInfoStore iStore = (IInfoStore) enterpriseSession.getService("InfoStore");<br>

<br>

// Store the IInfoStore object in the session using the<br>

// helper functions.<br>

session.setAttribute("InfoStore", iStore);<br>

<br>

// Store the CMS name for later use.<br>

session.setAttribute("CMS", cms);<br>

<br>

// Retrieve the logon token manager.<br>

ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();<br>

<br>

// Retrieve a logon token and store it in the user's cookie<br>

// file for use later.<br>

Cookie cookie = new Cookie("LogonToken", logonTokenMgr.createLogonToken("", 60, 100));<br>

response.addCookie(cookie);<br>

<br>

// Store the logon token for later use.<br>

session.setAttribute("token", enterpriseSession.getLogonTokenMgr().getDefaultToken());<br>

}<br>

}<br>

<br>

// Redirect the user to the main infoview page.<br>

out.println("You have been logged on to Enterprise.");<br>

response.sendRedirect ("http://cmsname/custom/listing/main.do?appKind=InfoView&service=%2FInfoViewApp%2Fcommon%2FappService.do&loc=");<br>

<br>

0 Kudos

Configurable in the CMC