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.
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
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".
Discussions, help and advice about the Alfresco Development Framework.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.