cancel
Showing results for 
Search instead for 
Did you mean: 

External Authentication and issues with RSS and Web Scripts

patorjk
Champ in-the-making
Champ in-the-making
I'm using external authentication with Share and am logging a user in via a filter. You can see a skeleton version of the filter here:

http://stackoverflow.com/questions/7517122/alfresco-sso-with-cookie

However, I've noticed that when I try to access RSS feeds or the Web Scripts panel (/share/service/index) I get prompted for authentication, even though I'm already logged in. An example RSS url is this:

http://mywebhost:8080/share/feedservice/components/documentlibrary/feed/all/node/alfresco/company/ho...

Since I logged in externally, I can't re-enter my password because Alfresco doesn't know it. If I just try to enter that information, I get a server error (seen below). For the webscript page, if I try to refresh the webscripts, I'm taken to a blank white page.

Interestingly, for RSS, if I enter in my user name in with any password, I get this error:

A server error has occured.

There are a number of reasons why this could have happened:

    You have attempted to access a page that does not exist - check the URL in the address bar.
    You have attempted to access a page that is not accessable to you, such as a private Site dashboard.
    A valid page has been requested but the server was unable to render it due to an internal error - contact your administrator.

Return to your dashboard page

Alfresco Software Inc. © 2005-2011 All rights reserved.

If I enter the admin username and password OR my username with a blank password, I get this message:

Web Script Status 500 - Internal Error

The Web Script /share/page/feed/components/documentlibrary/feed/all/node/alfresco/company/home/ has responded with a status of 500 - Internal Error.

500 Description: An error inside the HTTP server which prevented it from fulfilling the request.

Message:

Unable to call doclist data webscript. Status: 401, response:

Server: Spring WebScripts - v1.0.0 (Release Candidate 2 948) schema 1,000
Time: Apr 6, 2012 6:16:39 PM
Diagnostics: Inspect Web Script (org/alfresco/components/documentlibrary/feed.get)

The catalina.out file looks like this when the admin information is entered:

2012-04-06 18:44:20,944  DEBUG [extensions.webscripts.AbstractRuntime] (Runtime=ServletRuntime, Container=Repository) Processing script url (GET) /slingshot/doclib/doclist/all/node/alfresco/company/home/User Homes/G/Gi/Gillespie/patrick.j.gillespie
2012-04-06 18:44:20,944  DEBUG [extensions.webscripts.AbstractRuntime] Agent: null
2012-04-06 18:44:20,944  DEBUG [extensions.webscripts.AbstractRuntime] Invoking Web Script org/alfresco/slingshot/documentlibrary/doclist.get (format json, style: argument, default: json)
2012-04-06 18:44:20,944  DEBUG [security.authentication.SimpleAcceptOrRejectAllAuthenticationComponentImpl] Authenticating user "admin"
2012-04-06 18:44:20,944  DEBUG [security.authentication.SimpleAcceptOrRejectAllAuthenticationComponentImpl] Failed to authenticate user "admin"
org.alfresco.repo.security.authentication.AuthenticationException: 03060244 Access Denied

Like this if there's a username but no password:

18:46:35,123  ERROR [alfresco.web.site] org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.extensions.surf.exception.WebScriptsPlatformException: 03060004 Authorization request did not provide user/pass.org.springframework.extensions.surf.exception.WebScriptsPlatformException: 03060004 Authorization request did not provide user/pass.

And like this if there's a username and a password:

2012-04-06 18:47:59,126  DEBUG [extensions.webscripts.AbstractRuntime] (Runtime=ServletRuntime, Container=Repository) Processing script url (GET) /slingshot/doclib/doclist/all/node/alfresco/company/home/User Homes/G/Gi/Gillespie/patrick.j.gillespie
2012-04-06 18:47:59,126  DEBUG [extensions.webscripts.AbstractRuntime] Agent: null
2012-04-06 18:47:59,126  DEBUG [extensions.webscripts.AbstractRuntime] Invoking Web Script org/alfresco/slingshot/documentlibrary/doclist.get (format json, style: argument, default: json)
2012-04-06 18:47:59,126  DEBUG [security.authentication.SimpleAcceptOrRejectAllAuthenticationComponentImpl] Authenticating user "patrick.j.gillespie"
2012-04-06 18:47:59,126  DEBUG [security.authentication.SimpleAcceptOrRejectAllAuthenticationComponentImpl] Failed to authenticate user "patrick.j.gillespie"
org.alfresco.repo.security.authentication.AuthenticationException: 03060254 Access Denied

Has anyone else experienced anything like this? Any clues on what could be going wrong?
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

in order for RSS feeds or feeds of any kind to reuse the same SSO solution you configured for your normal access, you need to also configure the alfresco-feed endpoint on Share in the same manner as the alfresco endpoint, which means pointing it to http://localhost:8080/alfresco/wcs
Beware that this may remove the ability of unauthenticated feed access depending on the feed web script called by the Share feedservice.

Also, in terms of your external authentication scenario: Isn't the out-of-the-box external authentication subsystem already all you need for such a solution?  In terms of Share support you may additionally need to supply your own Spring connector (similar thread), but apart from that, it should suit your needs.

Regards
Axel

cvazquez
Champ on-the-rise
Champ on-the-rise
Hello i have this error when i push rss buttom, thank you

The Web Script /share/page/feed/components/documentlibrary/feed/all/site/proyectos-externos/documentLibrary/ has responded with a status of 500 - Internal Error.


500 Description: An error inside the HTTP server which prevented it from fulfilling the request.
 
Message: Failed to initialize RequestContext for local WebScript runtime: Unable to initialise user during Request Context init. Probably a stale user Session.
  
Exception: java.io.IOException - Failed to initialize RequestContext for local WebScript runtime: Unable to initialise user during Request Context init. Probably a stale user Session.
  
org.springframework.extensions.webscripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:210)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:377)
org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
org.springframework.extensions.webscripts.servlet.mvc.WebScriptView.renderMergedOutputModel(WebScriptView.java:104)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:722)
  
Server: Spring WebScripts - v1.2.0 (Release 1207) schema 1,000
Time: 19/11/2013 11:50:44 AM
  
Diagnostics: Inspect Web Script (org/alfresco/components/documentlibrary/feed.get)