Hi,
I've implemented the authelia in quick way (nginx+local users) following the guide provided.
I've been able to register, and login with authenticator.
But, when I try to access a protected site after 2TFA, I receive a 401.
Authelia logs are following :
error: date='Wed Feb 27 2019 12:13:10 GMT+0100 (Central European Standard Time)' method='GET', path='/api/verify' requestId='b684ff5c-cbd8-4da4-90a2-b1815633402b' sessionId='a6kFHxkSvjufUupAYJYDs0XqKHTFN9Fa' ip='x.x.x.x' message='Reply with error 401: Cannot read property 'domain' of undefined'
Please could you help to point what I missed ?
Hello @CrazyVolnay , do you have a stack trace that can help me point out where this exception is thrown?
Hello @CrazyVolnay , any news?
I've seen those errors when not properly setting the X-* headers.
First time posting. I have a similar local development setup using docker. Discarded MongoDB, Discarded Redis, Discarded LDAP. Using NGINX to proxy connections. All goes well with TOTP authentication and I get loggedin page. /api/verify only returns 401 afterward, and I get the following in my log.
Any leads would be appreciated. Please and thank you.
debug: date='Sat Mar 16 2019 21:24:25 GMT+0000 (UTC)' method='GET', path='/api/verify' requestId='e80075ad-82d4-4429-bbed-8333e24ca676' sessionId='UFII1M39xGlkn2AcBuUPA5QFN7o8UVTp' ip='192.168.1.202' message='Headers = {"host":"home.xxxxxxxxx.com","connection":"close","x-tls-cipher":"ECDHE-RSA-AES256-GCM-SHA384","x-tls-protocol":"TLSv1.2","x-tls-sni-host":"home.xxxxxxxxx.com","x-real-ip":"192.168.1.202","x-forwarded-for":"192.168.1.202","x-forwarded-proto":"https","x-tls-client-intercepted":"Unknown","cache-control":"max-age=0","upgrade-insecure-requests":"1","dnt":"1","user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36","accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8","accept-encoding":"gzip, deflate, br","accept-language":"en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7,mt;q=0.6","cookie":"authelia_session=s%3AUFII1M39xGlkn2AcBuUPA5QFN7o8UVTp.RhH%2BhritbwiZCn4GE2C%2B%2Bg%2B2tQyNNVb35Om5n0pbAO8"}'
error: date='Sat Mar 16 2019 21:24:25 GMT+0000 (UTC)' method='GET', path='/api/verify' requestId='e80075ad-82d4-4429-bbed-8333e24ca676' sessionId='UFII1M39xGlkn2AcBuUPA5QFN7o8UVTp' ip='192.168.1.202' message='Reply with error 401: Cannot read property 'domain' of undefined'
debug: date='Sat Mar 16 2019 21:24:25 GMT+0000 (UTC)' method='GET', path='/api/verify' requestId='e80075ad-82d4-4429-bbed-8333e24ca676' sessionId='UFII1M39xGlkn2AcBuUPA5QFN7o8UVTp' ip='192.168.1.202' message='TypeError: Cannot read property 'domain' of undefined
at BluebirdPromise.resolve.then (/usr/src/server/src/lib/routes/verify/get_session_cookie.js:36:76)
at tryCatcher (/usr/src/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/src/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/usr/src/node_modules/bluebird/js/release/promise.js:569:18)
at Promise._settlePromiseCtx (/usr/src/node_modules/bluebird/js/release/promise.js:606:10)
at _drainQueueStep (/usr/src/node_modules/bluebird/js/release/async.js:142:12)
at _drainQueue (/usr/src/node_modules/bluebird/js/release/async.js:131:9)
at Async._drainQueues (/usr/src/node_modules/bluebird/js/release/async.js:147:5)
at Immediate.Async.drainQueues (/usr/src/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:785:20)
at tryOnImmediate (timers.js:747:5)
at processImmediate [as _immediateCallback] (timers.js:718:5)'
X-Original-URL is missing.
Thanks @SurinameClubcard this fixed it up.
In an earlier test I used X-Original-URI as I saw this in many examples. Using X-Original-URL did the trick.
I added some logs and a documentation about nginx configuration in https://github.com/clems4ever/authelia/blob/master/docs/proxies/nginx.md to better avoid or find this kind of issue.
Most helpful comment
I added some logs and a documentation about nginx configuration in https://github.com/clems4ever/authelia/blob/master/docs/proxies/nginx.md to better avoid or find this kind of issue.