---
title: "G White (@grawfin) | Hashnode"
description: "dev. Read the latest articles by G White on Hashnode."
url: "https://hashnode.com/@grawfin"
---

@grawfin

# G White

@grawfin · Joined August 2023

dev

## Comments

[Edwin Ayabie Understood, thanks!](https://hashnode.com/posts/securing-your-fastapi-with-api-key-authentication-a-step-by-step-guide/6454e99f6c5f0bc0d2246389/comment/64e4ddab3ca789daeb378502#reply-64e4e495bdabeadbcf84fb96)

Reply · Article · Aug 22, 2023 · [Securing Your FastAPI with API Key Authentication: A Step-by-Step Guide](https://hashnode.com/posts/securing-your-fastapi-with-api-key-authentication-a-step-by-step-guide/6454e99f6c5f0bc0d2246389)

[Hello, I have a question about the function verify\_api\_key()... Underneath the comment "#verifying extract ..... the prefix", we then verify the corresponding hashed\_api\_key with the function verify\_hashed\_key(). Can you explain why this step is necessary / preferred? As I understand, we only reach this step if the secret\_key the user sent in the Header() was found in the database, and therefore it seems it should be enough to simply return the corresponding user\_id, before we ever run the verify\_hashed\_key() function. I would greatly appreciate any insight here, thank you!](https://hashnode.com/posts/securing-your-fastapi-with-api-key-authentication-a-step-by-step-guide/6454e99f6c5f0bc0d2246389/comment/64e4ddab3ca789daeb378502)

Comment · Article · Aug 22, 2023 · [Securing Your FastAPI with API Key Authentication: A Step-by-Step Guide](https://hashnode.com/posts/securing-your-fastapi-with-api-key-authentication-a-step-by-step-guide/6454e99f6c5f0bc0d2246389)
