# Dash Authentication Issue

**URL:** <https://community.plotly.com/t/dash-authentication-issue/9990>\
**Category:** Dash Python\
**Created:** [April 29, 2018, 10:51pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990 "2018-04-29T22:51:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gillmonii](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@gillmonii](https://community.plotly.com/u/gillmonii)\
**Post date:** [April 29, 2018, 10:51pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990/1 "2018-04-29T22:51:36Z")

</div>

Hi, I’m trying to add basic dash authentication following this tutotrial

> **[Authentication | Dash for Python Documentation | Plotly](https://dash.plotly.com/authentication)**
>
> Protect your apps behind a login screen and access user authentication data in your Dash apps.

And upon doing so getting the following error locally:

> Traceback (most recent call last):  
> File “index.py”, line 13, in   
> from appc import app, server  
> File “C:\Users\USER\Desktop\Folder\SubFolder\appc.py”, line 31, in   
> APP\_URL  
> File “C:\Users\USER\Anaconda3\lib\site-packages\dash\_auth\plotly\_auth.py”, line 37, in **init**  
> salt=app\_name  
> File “C:\Users\USER\Anaconda3\lib\site-packages\dash\_auth\oauth.py”, line 24, in **init**  
> Auth. **init** (self, app)  
> File “C:\Users\USER\Anaconda3\lib\site-packages\dash\_auth\auth.py”, line 10, in **init**  
> self.\_index\_view\_name = app.config[‘routes\_pathname\_prefix’]  
> TypeError: ‘type’ object is not subscriptable

Please note that without authentication my web app runs locally and on Heroku without an issue.  
It’s a multipaged app so i’ve segmented it into different files.

`index.py` imports `'app'` and `'server'` from `appc.py` file.

* * *

> Traceback (most recent call last):  
> File “index.py”, line 13, in   
> from appc import app, server  
> File “C:\Users\USER\Desktop\Folder\SubFolder\appc.py”, line 31, in   
> APP\_URL  
> File “C:\Users\USER\Anaconda3\lib\site-packages\dash\_auth\plotly\_auth.py”, line 37, in **init**  
> salt=app\_name  
> File “C:\Users\USER\Anaconda3\lib\site-packages\dash\_auth\oauth.py”, line 24, in **init**  
> Auth. **init** (self, app)  
> File “C:\Users\USER\Anaconda3\lib\site-packages\dash\_auth\auth.py”, line 10, in **init**  
> self.\_index\_view\_name = app.config[‘routes\_pathname\_prefix’]  
> TypeError: ‘type’ object is not subscriptable

Above error is seen on trying to use PlotlyAuth authentication method.

Versions:

> dash 0.21.0  
> dash-auth 1.0.0  
> dash-core-components 0.13.0rc4  
> dash-html-components 0.10.0  
> dash-renderer 0.12.1  
> dash-table-experiments 0.6.0  
> dash.ly 0.17.3

Not sure if this is a bug or not.  
Any help appreciated.  
Thanks

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [April 29, 2018, 11:23pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990/2 "2018-04-29T23:23:36Z")

</div>

> [@gillmonii](#):
>
> dash.ly 0.17.3

This isn’t right - I’d try uninstalling this package, it was left over from a previous era.

---

<div class="post-metadata">

**Author:** ![gillmonii](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@gillmonii](https://community.plotly.com/u/gillmonii)\
**Post date:** [April 29, 2018, 11:33pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990/3 "2018-04-29T23:33:38Z")

</div>

Done.  
Solved the problem. 🙂

Thanks

---

<div class="post-metadata">

**Author:** ![adamstimb](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamstimb/32/2626_2.png) [@adamstimb](https://community.plotly.com/u/adamstimb)\
**Post date:** [August 27, 2018, 9:20am UTC](https://community.plotly.com/t/dash-authentication-issue/9990/4 "2018-08-27T09:20:45Z")

</div>

Hi. I also had this error and found out I had dash.ly installed in my base environment so, although it wasn’t showing up in pip list, it was still breaking app.config. When I uninstalled dash, dash.ly, flask, and whole bunch of other stuff from my base env it worked perfectly. I guess I must have installed in base before I learned better habits… So the lesson I learned is: Keep your base env lean and clean 😃

---

<div class="post-metadata">

**Author:** ![Naresh](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@Naresh](https://community.plotly.com/u/Naresh)\
**Post date:** [August 29, 2018, 4:54am UTC](https://community.plotly.com/t/dash-authentication-issue/9990/5 "2018-08-29T04:54:55Z")

</div>

Hello All. I was having a issue with plotly auth. Attached the error, please help me in rectifying this. Thanks much in advance. If someone could help me rectify, would be much appreciable and thankful. I have been trying to get some help to get this done for the past one month to solve this. Couldn’t find any help so far, trying to post these script in few other portals too, no solutions to it. :(😣

 ![Plotly%20Auth](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/b/ba96f4e2363133779ca55848deaa94f2d196e265.png)

---

<div class="post-metadata">

**Author:** ![jquin](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jquin/32/4404_2.png) [@jquin](https://community.plotly.com/u/jquin)\
**Post date:** [October 10, 2018, 10:23pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990/6 "2018-10-10T22:23:06Z")

</div>

Im also having this issue. Im using a virtual environment. I dont have dash.ly isntalled on base env nor in virtual env

requirements.txt:  
certifi==2018.8.24  
chardet==3.0.4  
Click==7.0  
dash==0.28.1  
dash-core-components==0.32.0  
dash-html-components==0.13.2  
dash-renderer==0.14.1  
decorator==4.3.0  
Flask==1.0.2  
Flask-Compress==1.4.0  
gunicorn==19.9.0  
idna==2.7  
ipython-genutils==0.2.0  
itsdangerous==0.24  
Jinja2==2.10  
jsonschema==2.6.0  
jupyter-core==4.4.0  
MarkupSafe==1.0  
nbformat==4.4.0  
plotly==3.3.0  
pytz==2018.5  
requests==2.19.1  
retrying==1.3.3  
six==1.11.0  
traitlets==4.3.2  
urllib3==1.23  
Werkzeug==0.14.1

---

<div class="post-metadata">

**Author:** ![caiyij](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/caiyij/32/4462_2.png) [@caiyij](https://community.plotly.com/u/caiyij)\
**Post date:** [October 17, 2018, 7:39pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990/7 "2018-10-17T19:39:42Z")

</div>

You don’t even have dash-auth, and the topic is about dash authentication. ??

---

<div class="post-metadata">

**Author:** ![jquin](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jquin/32/4404_2.png) [@jquin](https://community.plotly.com/u/jquin)\
**Post date:** [October 17, 2018, 8:32pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990/8 "2018-10-17T20:32:43Z")

</div>

Wow you are right! So dumb of me. I never updated the requirements.txt to include the dash-auth.  
You dont have to be so rude tough, everyone make mistakes. Thanks.

---

<div class="post-metadata">

**Author:** ![caiyij](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/caiyij/32/4462_2.png) [@caiyij](https://community.plotly.com/u/caiyij)\
**Post date:** [October 17, 2018, 8:45pm UTC](https://community.plotly.com/t/dash-authentication-issue/9990/9 "2018-10-17T20:45:31Z")

</div>

Apologies, I was just confused by your post.
