# API Key as a query string parameter is a security risk, right?

**URL:** <https://meta.discourse.org/t/api-key-as-a-query-string-parameter-is-a-security-risk-right/67661>\
**Category:** Development\
**Created:** [08.Август.2017 17:00:46 UTC](https://meta.discourse.org/t/api-key-as-a-query-string-parameter-is-a-security-risk-right/67661 "2017-08-08T17:00:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![SwisherSweet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swishersweet/32/119523_2.png) [@SwisherSweet](https://meta.discourse.org/u/SwisherSweet)\
**Post date:** [08.Август.2017 20:09:17 UTC](https://meta.discourse.org/t/api-key-as-a-query-string-parameter-is-a-security-risk-right/67661/3 "2017-08-08T20:09:17Z")

</div>

> [@zogstrip](#):
>
> Having the API key in the header instead of a query parameter won’t help security-wise 😉
> 
> If you use https, you should be good.

@zogstrip thank you for your reply. I tried putting the API key and API user in the header because when the request is made over HTTPS, [that data is encrypted](https://stackoverflow.com/questions/187655/are-https-headers-encrypted).

However after further research, I found that even [query string parameters are encrypted](http://blog.httpwatch.com/2009/02/20/how-secure-are-query-strings-over-https/) when accessing the API over HTTPS, although it’s [not encouraged](https://stackoverflow.com/questions/2629222/are-querystring-parameters-secure-in-https-http-ssl) since the URLs with the query string parameters may still live in the web server logs in clear text. There does appear to be a way to [filter this sensitive data](https://stackoverflow.com/questions/2062405/filtering-parts-or-all-of-request-url-from-rails-logs) out on Rails applications.

---

_[View the full topic](https://meta.discourse.org/t/api-key-as-a-query-string-parameter-is-a-security-risk-right/67661)._
