ADF First App login

cancel
Showing results for 
Search instead for 
Did you mean: 
ramyakandasamy
Member II

ADF First App login

Not able to log in First ADF app.

error :

Failed to load resource: the server responded with a status of 401 (Unauthorized)
login:1 Access to XMLHttpRequest at 'http://127.0.0.1:8083/alfresco/api/-default-/public/authentication/versions/1/tickets' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
adf-core.js:831 Error when logging in Object
push../node_modules/@alfresco/adf-core/fesm5/adf-core.js.LogService.error @ adf-core.js:831
core.js:12584 ERROR Error: Uncaught (in promise): Object: {"error":{"crossDomain":true,"method":"POST","url":"http://127.0.0.1:8083/alfresco/api/-default-/public/authentication/versions/1/tickets"}}
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:14134)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:422)
at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
at drainMicroTaskQueue (zone.js:601)
at ZoneTask.push../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask [as invoke] (zone.js:502)
at invokeTask (zone.js:1744)
defaultErrorLogger @ core.js:12584
login:1 Access to XMLHttpRequest at 'http://localhost:8009/activiti-app/app/authentication' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

2 Replies
eugenio_romano
Alfresco Employee

Re: ADF First App login

Hi have you read about CORS in all ADF documents or previous questions?

https://github.com/Alfresco/alfresco-ng2-components/blob/development/ALFRESCOCORS.md

https://github.com/Alfresco/alfresco-ng2-components/blob/development/PREREQUISITES.md

For more information about CORS please crawl in internet also is a really common problem between Front End and Back end app when they are not on the same domain

ramyakandasamy
Member II

Re: ADF First App login

Thanks for your help. My issue is solved by enabling CORS in activiti app properties file and setting correct provider property in app.config.json.

For our project we use only BPM service, So I set providers property as "BPM".