# fetch를 통해 API에 접근할 때 API 키로 인증하기

**URL:** <https://meta.discourse.org/t/authenticating-using-api-keys-when-accessing-api-through-fetch/134149>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [11월 22, 2019, 12:32오후 UTC](https://meta.discourse.org/t/authenticating-using-api-keys-when-accessing-api-through-fetch/134149 "2019-11-22T12:32:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Lucas\_Meijer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucas_meijer/32/157389_2.png) [@Lucas\_Meijer](https://meta.discourse.org/u/Lucas_Meijer)\
**Post date:** [11월 27, 2019, 4:55오후 UTC](https://meta.discourse.org/t/authenticating-using-api-keys-when-accessing-api-through-fetch/134149/3 "2019-11-27T16:55:01Z")

</div>

감사합니다! 인증 부분을 어떻게 놓쳤을지 상상도 안 됩니다. 문서를 몇 번이고 다시 확인했는데도요 😂

어쨌든 조금씩 진전이 있는 것 같긴 한데, 이제 브라우저 콘솔에서 이런 문제가 발생하고 있습니다:  
`(Reason: missing token ‘api-key’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel).`

원인이 무엇인지 잘 모르겠고, 포럼에서도 관련 내용을 찾을 수가 없네요. 제가 놓치고 있는 부분이 있을까요? 이상한 건 제 코드에서는 헤더를 'Api-Key’로 지정하고 있다는 점입니다. 혹시 아이디어가 있으신가요? 🙂

---

_[View the full topic](https://meta.discourse.org/t/authenticating-using-api-keys-when-accessing-api-through-fetch/134149)._
