<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Setting custom rest authenticator in rest-webapp in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170314#M123609</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I solved it this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) Create the class org.activiti.rest.common.filter.RestAuthenticatorImpl.java which implements the method public boolean requestRequiresAuthentication(Request request)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) Set your custom RestAuthenticator in org.activiti.rest.common.application.ActivitiRestApplication.java like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Constructor public ActivitiRestApplication(), add these lines of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;restAuthenticator = new RestAuthenticatorImpl();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setRestAuthenticator(restAuthenticator);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2014 10:37:58 GMT</pubDate>
    <dc:creator>b_schnarr</dc:creator>
    <dc:date>2014-05-15T10:37:58Z</dc:date>
    <item>
      <title>Setting custom rest authenticator in rest-webapp</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170311#M123606</link>
      <description>Hello at all,we want to implement SSO in the activiti-rest webapp. Therefore, we need to disable the build in rest basic authentication. To achieve this, I created a subclass of org.activiti.rest.service.application.ActivitiRestServicesApplication that implements the method boolean requestRequiresAu</description>
      <pubDate>Fri, 09 May 2014 10:42:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170311#M123606</guid>
      <dc:creator>b_schnarr</dc:creator>
      <dc:date>2014-05-09T10:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: Setting custom rest authenticator in rest-webapp</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170312#M123607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No ideas? Maybe I have forgotten something? I created a subclass of org.activiti.rest.service.application.ActivitiRestServicesApplication that implements just one method of the CustomRestAuthenticator (boolean requestRequiresAuthentication(Request request)). But this seems not to be sufficient. But in the documentation, there is nothing more to read about that. In anothe post, there is written: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"The custom implementation fo the RestAuthenticator can be set on the instance of the org.activiti.rest.common.application.ActivitiRestApplication (or org.activiti.rest.service.application.ActivitiRestServicesApplication)."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I have no idea how to do this. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you and best regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 May 2014 10:22:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170312#M123607</guid>
      <dc:creator>b_schnarr</dc:creator>
      <dc:date>2014-05-13T10:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Setting custom rest authenticator in rest-webapp</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170313#M123608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Maybe, the class org.activiti.rest.common.application.ActivitiRestApplication is helpful. There you can find the following method:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// Set authenticator as a NON-optional filter. If certain request require no authentication, a custom RestAuthenticator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// should be used to free the request from authentication.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;authenticator = new ChallengeAuthenticator(null, true, ChallengeScheme.HTTP_BASIC,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Activiti Realm") {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; protected boolean authenticate(Request request, Response response) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check if authentication is required if a custom RestAuthenticator is set&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(restAuthenticator != null &amp;amp;&amp;amp; !restAuthenticator.requestRequiresAuthentication(request)) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (request.getChallengeResponse() == null) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boolean authenticated = super.authenticate(request, response);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(authenticated &amp;amp;&amp;amp; restAuthenticator != null) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Additional check to see if authenticated user is authorised. By default, when no RestAuthenticator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // is set, a valid user can perform any request.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authenticated = restAuthenticator.isRequestAuthorized(request);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return authenticated;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;authenticator.setVerifier(verifier);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But still, I do not understand how to "set" my custom rest authenticator. The official docu just states that the org.activiti.rest.common.filter.RestAuthenticator interface needs to be implemented and in addition, the web.xml needs to be altered. I did this, but the API still wants to have basic credentials. So I think I must "set" my custom implementation somehow?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is welcome. Thanks a lot&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ben&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 08:50:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170313#M123608</guid>
      <dc:creator>b_schnarr</dc:creator>
      <dc:date>2014-05-15T08:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Setting custom rest authenticator in rest-webapp</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170314#M123609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I solved it this way:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1.) Create the class org.activiti.rest.common.filter.RestAuthenticatorImpl.java which implements the method public boolean requestRequiresAuthentication(Request request)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) Set your custom RestAuthenticator in org.activiti.rest.common.application.ActivitiRestApplication.java like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Constructor public ActivitiRestApplication(), add these lines of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;restAuthenticator = new RestAuthenticatorImpl();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setRestAuthenticator(restAuthenticator);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 10:37:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170314#M123609</guid>
      <dc:creator>b_schnarr</dc:creator>
      <dc:date>2014-05-15T10:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setting custom rest authenticator in rest-webapp</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170315#M123610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you please show me an example of how to check the request object in this method :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;boolean requestRequiresAuthentication(Request request);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is authenticated over a CAS server? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 12:04:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170315#M123610</guid>
      <dc:creator>golden_boy_t</dc:creator>
      <dc:date>2015-09-29T12:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Setting custom rest authenticator in rest-webapp</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170316#M123611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Which Activiti version do you use? Since Activiti 5.17, Spring Security is used to secure the REST-API. Therefore, this thread here is not up-to-date anymore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In addition, what do you want to check in the request object?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 12:08:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/setting-custom-rest-authenticator-in-rest-webapp/m-p/170316#M123611</guid>
      <dc:creator>b_schnarr</dc:creator>
      <dc:date>2015-09-29T12:08:07Z</dc:date>
    </item>
  </channel>
</rss>

