TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

PKCE: What and Why

60 pointsby luordover 4 years ago

5 comments

sradmanover 4 years ago
OAuth 2.0 PKCE (pronounced &quot;pixy&quot;) [1] is described in <i>RFC 7636: Proof Key for Code Exchange by OAuth Public Clients</i> [2]:<p>&gt; OAuth 2.0 public clients utilizing the Authorization Code Grant are susceptible to the authorization code interception attack. This specification describes the attack as well as a technique to mitigate against the threat through the use of Proof Key for Code Exchange (PKCE, pronounced &quot;pixy&quot;).<p>[1] <a href="https:&#x2F;&#x2F;oauth.net&#x2F;2&#x2F;pkce&#x2F;" rel="nofollow">https:&#x2F;&#x2F;oauth.net&#x2F;2&#x2F;pkce&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc7636" rel="nofollow">https:&#x2F;&#x2F;tools.ietf.org&#x2F;html&#x2F;rfc7636</a>
8organicbitsover 4 years ago
I really like the pseudo sequence diagram they used. Usually I&#x27;d draw all the arrows between the actors, which would end up looking very formal. The cartoon talking bubble with plain language seems much more casual and accessible!
mooredsover 4 years ago
Don&#x27;t forget if you are using a public client, you need to be concerned not just with the client secret, but also with the access token. Unless the token is sender constrained (via MTLS, DPOP or something similar), <i>anyone</i> who gets it can use it to access whatever resources it grants permission to.<p>While losing a client secret to an attacker is obviously worse, because it allows for repeated grant requests, losing an access token can be bad too.<p>So, be aware of both things when you are running in a client like a browser or mobile application which can&#x27;t be trusted to keep a secret. You can try to minimize the risk by using a HttpOnly cookie for the browser or secure storage (keychain, etc) on a mobile app, as well as keeping your token lifetimes short.<p>Disclosure: I work for an IDaaS provider.
boukover 4 years ago
I&#x27;m curious why we are still messing around with all these tokens when we could be using asymmetric encryption, like Apple is using for their AppStore connect API <a href="https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;appstoreconnectapi&#x2F;generating_tokens_for_api_requests" rel="nofollow">https:&#x2F;&#x2F;developer.apple.com&#x2F;documentation&#x2F;appstoreconnectapi...</a><p>Just seems fundamentally more secure.
评论 #25317193 未加载
pm90over 4 years ago
I don’t think I understand the attack scenario that this flow prevents even after reading the rfc. Can anyone explain?
评论 #25315875 未加载