# Collection with authentification

**URL:** <https://community.weweb.io/t/collection-with-authentification/1348>\
**Category:** Ask us anything\
**Tags:** authentication\
**Created:** [October 24, 2022, 8:43am UTC](https://community.weweb.io/t/collection-with-authentification/1348 "2022-10-24T08:43:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahusset](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@ahusset](https://community.weweb.io/u/ahusset)\
**Post date:** [October 24, 2022, 8:43am UTC](https://community.weweb.io/t/collection-with-authentification/1348/1 "2022-10-24T08:43:05Z")

</div>

Hello,

I would like to setup a collection that will need an authentification but I will get the auth token when I will run the app and depending on the user.  
I can get my data from the rest api and use my auth token in a variable but I think I will loose the benefit of the “collection”.  
what is the best practice in this case ?

Thanks for your help  
Alex

---

<div class="post-metadata">

**Author:** ![Mael](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/mael/32/13246_2.png) [@Mael](https://community.weweb.io/u/Mael)\
**Post date:** [October 26, 2022, 7:59am UTC](https://community.weweb.io/t/collection-with-authentification/1348/2 "2022-10-26T07:59:40Z")

</div>

Hello,

Which auth plugin are you using? It will help me to give you adivce 🙂

---

<div class="post-metadata">

**Author:** ![ahusset](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@ahusset](https://community.weweb.io/u/ahusset)\
**Post date:** [October 26, 2022, 8:45am UTC](https://community.weweb.io/t/collection-with-authentification/1348/3 "2022-10-26T08:45:16Z")

</div>

in cas of xano I think it is ok but If I am using the rest API also for the auth I do not think it will work.
