Menu

Getting forbidden response for AEM login page

If  you are facing problem to access the AEM login page; /libs/granite/core/content/login.html and getting HTTPERROR 403, FORBIDDEN and in log you are getting below error message. Its means somehow you have updated the SlingAuthenticator configuration.

*INFO* [0:0:0:0:0:0:0:1 [1402592178132] GET / HTTP/1.1] org.apache.sling.auth.core.impl.SlingAuthenticator getAnonymousResolver: Anonymous access not allowed by configuration - requesting credentials
*INFO* [0:0:0:0:0:0:0:1 [1402592178132] GET / HTTP/1.1] org.apache.sling.auth.core.impl.SlingAuthenticator handleLoginFailure: Unable to authenticate anonymous user: Login Failure: all modules ignored

AEM login page forbidden error, http error 403
AEM login page forbidden

Resolution:


Step 1: Under the configuration "Apache Sling Authentication Serviceverify the entry of login page in property Authentication Requirements (sling.auth.requirements) set with minus symbol [-/libs/granite/core/content/login]. If you found the correct entry then check the second step.

Step 2: We have another property sling.auth.anonymous.user under the same configuration. Somehow this property has been updated hence system is unable to open the login page which should be accessible to anonymous user. 

Explanation of sling.auth.anonymous.user property; it defines which user name to assume for anonymous requests, that is requests not providing credentials supported by any of the registered authentication handlers. If this property is missing or empty, the default is assumed which depends on the resource provider(s). Otherwise anonymous requests are handled with this user name. If the configured user name does not exist or is not allowed to access the resource data, anonymous requests may still be blocked. If anonymous access is not allowed, this property is ignored.



To fix this issue, go to AEM config manager [/system/console/configMgr] and search for "Apache Sling Authentication Service" or go directly using this link in your local AEM instance 
http://localhost:4502/system/console/configMgr/org.apache.sling.engine.impl.auth.SlingAuthenticator

But since, we are unable to login into the AEM, and without login we cant access the felix console(config manager). Hence we will upadte the config from crx-quickstart repository. The same config file we will find in our crx-quickstart folder under directory launchpad
\crx-quickstart\launchpad\config\org\apache\sling\engine\impl\auth
in this file if you see there is some value assign to property sling.auth.anonymous.user then make it empty like sling.auth.anonymous.user=""

Sample SlingAuthenticator.config file



La Ilaha Illallah

Khudi ka sirr-e-nihan la-ilaha-illallah 
Khudi hai tegh fasan la-ilaha-illallah 

ye daur apne barahim ki talash mein hai 
sanam-kada hai jahan la-ilaha-illallah 

kiya hai tu ne mata-e-ghurur ka sauda 
fareb-e-sud-o-ziyan la-ilaha-illallah 

ye mal-o-daulat-e-duniya ye rishta o paiwand 
butan-e-wahm-o-guman la-ilaha-illallah 

Khirad hui hai zaman o makan ki zunnari 
na hai zaman na makan la-ilaha-illallah 

ye naghma fasl-e-gul-o-lala ka nahin paband 
bahaar ho ki Khizan la-ilaha-illallah 

agarche but hain jamaat ki aastinon mein 
mujhe hai hukm-e-azan la-ilaha-illallah 

-----------------------------------------------

ख़ुदी का सिर्र-ए-निहाँ ला-इलाहा-इल्लल्लाह 
ख़ुदी है तेग़ फ़साँ ला-इलाहा-इल्लल्लाह 

ये दौर अपने बराहीम की तलाश में है 
सनम-कदा है जहाँ ला-इलाहा-इल्लल्लाह 

किया है तू ने मता-ए-ग़ुरूर का सौदा 
फ़रेब-ए-सूद-ओ-ज़ियाँ ला-इलाहा-इल्लल्लाह 

ये माल-ओ-दौलत-ए-दुनिया ये रिश्ता ओ पैवंद 
बुतान-ए-वहम-ओ-गुमाँ ला-इलाहा-इल्लल्लाह 

ख़िरद हुई है ज़मान ओ मकाँ की ज़ुन्नारी 
न है ज़माँ न मकाँ ला-इलाहा-इल्लल्लाह 

ये नग़्मा फ़स्ल-ए-गुल-ओ-लाला का नहीं पाबंद 
बहार हो कि ख़िज़ाँ ला-इलाहा-इल्लल्लाह 

अगरचे बुत हैं जमाअत की आस्तीनों में 
मुझे है हुक्म-ए-अज़ाँ ला-इलाहा-इल्लल्लाह 

----------------------------------------------------------

خودی کا سر نہاں لا الہ الا اللہ 
خودی ہے تیغ فساں لا الہ الا اللہ 


یہ دور اپنے براہیم کی تلاش میں ہے 

صنم کدہ ہے جہاں لا الہ الا اللہ 


کیا ہے تو نے متاع غرور کا سودا 

فریب سود و زیاں لا الہ الا اللہ 


یہ مال و دولت دنیا یہ رشتہ و پیوند 

بتان وھم و گماں لا الہ الا اللہ 


خرد ہوئی ہے زمان و مکاں کی زناری 

نہ ہے زماں نہ مکاں لا الہ الا اللہ 


یہ نغمہ فصل گل و لالہ کا نہیں پابند 

بہار ہو کہ خزاں لا الہ الا اللہ 


اگرچہ بت ہیں جماعت کی آستینوں میں 

مجھے ہے حکم اذاں لا الہ الا اللہ 

How to delete commits from a branch in Git?

Checkout the branch. e.g we are working here with development branch
$ git checkout development

Go to the commits list and copy the commit id till where you want to remove the commits from branch. then run git reset --hard to delete the all commits above or after that commit id. e.g. commit id is "c9709eb155e18e2eb12e38bf
$ git reset --hard c9709eb155e18e2eb12e38bf

You will got a success message saying "HEAD is now at <commitid> <commit message>". It means your reset is successful.

Now run the git push to push the commit till this commit id to your branch.
$ git push origin development --force


Related Articles:

How to cherry pick in Git