cancel
Showing results for 
Search instead for 
Did you mean: 

[Resolved] How to open a file from Alfresco without authenti

unknown-user
Champ on-the-rise
Champ on-the-rise
Hi All

I am using a hyperlink in my jsp page. when i click on this link, it opens a new window and connect to the alfresco server. I want to open a file directly which exists on Alfresco server. For achiveing this functionality, I am using URL Addressability.
Now i can open the file directly from alfresco server . Before showing this file, it's showing alfrseco web client screen for authentication.after entering username & password only, it is showing the file.I want to open this file without alfrseco web client authentication screen.

To overcome this authentication screen problem, i am passing ticket id with the URL in the below code but still it is not working.
See the error after the code–

Code
public String searchAndDownload(){

WebServiceFactory.setEndpointAddress("http://localhost:8080/alfresco/api");
AuthenticationUtils.startSession(USERNAME, PASSWORD);
—————————————————————
————————————————————–
ticket = AuthenticationUtils.getTicket();
—————————————————-
—————————————————
String url = "http://localhost:8080/alfresco/d/d/workspace/SpacesStore/'+nodeId+'/'+file+'?ticket='+ticket;
return url;
}

Error
  System Error  

java.lang.IllegalStateException: Cannot create a session after the response has been committed

Show Details
java.lang.IllegalStateException: Cannot create a session after the response has been committed
at org.apache.catalina.connector.Request.doGetSession(Request.java:2214)
at org.apache.catalina.connector.Request.getSession(Request.java:2024)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:831)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:842)
at org.alfresco.web.app.servlet.BaseServlet.redirectToLoginPage(BaseServlet.java:187)
at org.alfresco.web.app.servlet.BaseServlet.servletAuthenticate(BaseServlet.java:152)
at org.alfresco.web.app.servlet.BaseServlet.servletAuthenticate(BaseServlet.java:117)
at org.alfresco.web.app.servlet.DownloadContentServlet.doGet(DownloadContentServlet.java:100)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)


Kindly help me.

Regards
Nishant
3 REPLIES 3

unknown-user
Champ on-the-rise
Champ on-the-rise
Hi All

Now If i pass ticket id with URL then it is showing authentication screen and then it is not taking "admin" as a username and "admin" as a password.
if i use URL without ticket means like http://localhost:8080/alfresco/d/d/workspace/SpacesStore/'+nodeId+'/'+file
then only it takes username & password.

Regards
Nishant

unknown-user
Champ on-the-rise
Champ on-the-rise
Hi All

I have resolved this issue.
Actualy this was my coding mistake. I would like to help If anybuddy is facing this issue.

Regards
Nishant

anil585974
Champ in-the-making
Champ in-the-making
Hi Nishant,
 
     I need help regarding the same kind of requirement. I have one button in my webapplication from that button i need to access Alfresco Application without authentication it suppose to be land search screen..I need help regarding this…please suggest me how can we do that….
how we can generate Search URL based on the Ticket No ##………ASAP…

Regards
Anil Kumar.