Set properties for Java ReST API projects - Set properties for Java ReST API projects - Alfresco - Alfresco Events SDK for Out-of-Process Events - Alfresco/Alfresco-Events-SDK-for-Out-of-Process-Events/6.3/Alfresco-Events-SDK-for-Out-of-Process-Events/Install/Creating-event-handler-projects/Create-a-starting-point-Spring-project/Set-properties-for-Java-ReST-API-projects - 6.3 - 6.3

Alfresco Events SDK for Out-of-Process Events

Platform
Alfresco
Product
Alfresco Events SDK for Out-of-Process Events
Release
6.3
License
ft:lastPublication
2025-09-04T22:27:16.404000
ft:locale
en-US
Note: Skip this section if you are just creating a project for an Event handler client.

If you plan to create a project for a Java ReST API client, set the following properties to tell the ReST API client where the Content Services server is running and the endpoints for the ReST APIs:

# HTTP Basic Authentication that will be used by the API
content.service.security.basicAuth.username=admin
content.service.security.basicAuth.password=admin
# Location of the server and API endpoints
content.service.url=http://localhost:8080
content.service.path=/alfresco/api/-default-/public/alfresco/versions/1
search.service.path=/alfresco/api/-default-/public/search/versions/1

If you are using OAuth2 with Alfresco Identity Service, then you can use client-credential based authentication:

spring.security.oauth2.client.registration.alfresco-rest-api.provider=alfresco-identity-service
spring.security.oauth2.client.registration.alfresco-rest-api.client-id=clientId
spring.security.oauth2.client.registration.alfresco-rest-api.client-secret=clientSecret
spring.security.oauth2.client.registration.alfresco-rest-api.authorization-grant-type=client_credentials
spring.security.oauth2.client.provider.alfresco-identity-service.token-uri=${keycloak.auth-server-url}/auth/realms/${keycloak.realm}/protocol/openid-connect/token

Or OAuth2 password based authentication:

spring.security.oauth2.client.registration.alfresco-rest-api.provider=alfresco-identity-service
spring.security.oauth2.client.registration.alfresco-rest-api.client-id=clientId
spring.security.oauth2.client.registration.alfresco-rest-api.client-secret=clientSecret
spring.security.oauth2.client.registration.alfresco-rest-api.username=username
spring.security.oauth2.client.registration.alfresco-rest-api.password=pwd
spring.security.oauth2.client.registration.alfresco-rest-api.authorization-grant-type=password
spring.security.oauth2.client.provider.alfresco-identity-service.token-uri=${keycloak.auth-server-url}/auth/realms/${keycloak.realm}/protocol/openid-connect/token

Finally, if you want to provide a custom authentication mechanism, you can enable the delegated external authentication:

content.service.security.delegated=true

Provide a bean that implements the interface DelegatedAuthenticationProvider.