---
title: "Discussion on \"Securing Apps: Password Hashing, RBAC, OAuth, and OpenID Connect\" | Hashnode"
description: "Discussion on \"Securing Apps: Password Hashing, RBAC, OAuth, and OpenID Connect\". How apps really stay secure: password hashing with bcrypt, authentication vs authorization, RBAC, OAuth, and OpenID Connect, explained with Netflix."
url: "https://hashnode.com/posts/password-hashing-rbac-oauth-openid-connect/6aaf18133747863e7e16414a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Securing Apps: Password Hashing, RBAC, OAuth, and OpenID Connect](https://ayushjjainn.hashnode.dev/password-hashing-rbac-oauth-openid-connect?utm_source=hashnode&utm_medium=feed)

How apps really stay secure: password hashing with bcrypt, authentication vs authorization, RBAC, OAuth, and OpenID Connect, explained with Netflix.

Sep 19 · 44 min read · ayushjjainn.hashnode.dev  
Read the article

-   [#oidc](https://hashnode.com/tag/oidc)
-   [#oauth](https://hashnode.com/tag/oauth)
-   [#oauth2](https://hashnode.com/tag/oauth2)
-   [#backend-development](https://hashnode.com/tag/backend-development)
-   [#coding](https://hashnode.com/tag/coding)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#software-development](https://hashnode.com/tag/software-development)
-   [#rbac](https://hashnode.com/tag/rbac)
-   [#openid-connect](https://hashnode.com/tag/openid-connect)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#webdev](https://hashnode.com/tag/webdev)

## Written by

[Ayush Jain](https://hashnode.com/@ayushjjainn)

@ayushjjainn · Jaipur, RJ

  
[View profile](https://hashnode.com/@ayushjjainn)

Building cool things for the internet

I like making things with code. This is where I share my projects and the bugs I ran into.

## Responses 2

Markdown supported · ⌘↵ to post

[Mihai\_LeanZero](https://hashnode.com/@mihaileanzero)

[Sep 20](https://hashnode.com/posts/password-hashing-rbac-oauth-openid-connect/6aaf18133747863e7e16414a/comment/6aaf4f33be5748a2f4d07266)

Good rundown, especially the RBAC role-explosion section. One thing worth adding to the "return one identical message" habit: matching the error text is necessary but not sufficient if the two code paths take different amounts of time. Looking up a user and then running bcrypt costs real milliseconds, so a login endpoint that only calls bcrypt when the email exists leaks that difference through response timing even with identical error strings. The usual fix is to always run a bcrypt compare against a fixed dummy hash when the email isn't found, so both paths cost roughly the same and timing can't be used to enumerate valid emails.

[Ayush Jain](https://hashnode.com/@ayushjjainn)

[Sep 20](https://hashnode.com/posts/password-hashing-rbac-oauth-openid-connect/6aaf18133747863e7e16414a/comment/6aaf4f33be5748a2f4d07266#reply-6aaf706003667f5924242232)

Really good catch, thanks for this. You're right, matching the error string handles the content but not the timing. Since bcrypt is slow on purpose, the "email exists" path takes longer, and that gap alone is enough to enumerate valid emails even with identical error text. Fix is exactly what you said, always run a bcrypt compare, even when the email isn't found, against a fixed dummy hash, so both paths cost about the same. Folding this into the post with a note, appreciate it.
