Even `expires_in` requires care. The token expires in 3600s, but, from when? In the token there will be an `exp` with an absolute value, but `expires_in` in the envelope is relative -- relative to when? Relative to whenever the issuer issued the token, so relative to `iat`/`exp`. But you don't want to have to extract that from the token, and you won't get to if the token is encrypted, so the best you can do is add `expires_in` to now, but it has to be a clock value from before you send the request.
solarengineer 1 hours ago [-]
Should it instead be "expires_at" with a UTC value set by the issuer?
xnorswap 3 hours ago [-]
I have experience with this kind of issue so I am sympathetic to the demands, but not invalidating a refresh token the moment it is used is basically inviting replay attacks. Needing to "repair" OAuth integrations is just part and parcel of dealing with OAuth for APIs.
It will happen despite best efforts, so it's best to have a smooth workflow for users to be notified it needs repairing and be able to then address it quickly.
The "return 200 for errors" is a bugbear of mine too, it happens far too often. There's even one vendor for whom you need to determine whether a page renders as an HTML error page or whether it's really json in the response to detect whether your auth silently failed.
Nango is a nice product. For folks in the Elixir ecosystem, here’s a drop in library that is compatible with their provider library for the oauth management side of things: https://github.com/agoodway/tango
jzelinskie 8 hours ago [-]
Friendly reminder for folks to distinguish between authN and authZ (or better yet use the terms "identity"/"login" and "permissions").
This article's title could've used it to give the reader a much better impression of the subject matter.
Propelloni 3 hours ago [-]
We used to call this "authentication" and "authorization". Both are (were?) well known concepts in IAM. AuthN and AuthZ seems to be something people came up with to have a new name or for what? I'm really getting too old for this.
quibono 3 hours ago [-]
You can still call it that, it’s just a shorthand since most people end up shortening to “auth”.
vinckr 2 hours ago [-]
it's still the same thing just easier to type than the full word.
Natfan 26 minutes ago [-]
authn and authz are to authentication and authorization what i18n and l10n is to internationalization and localization
manfred_singer 6 hours ago [-]
[flagged]
VNGroundTruth 6 hours ago [-]
[flagged]
nora_harcourt 7 hours ago [-]
[flagged]
dean_draeger 7 hours ago [-]
[flagged]
Rendered at 12:07:50 GMT+0000 (Coordinated Universal Time) with Vercel.
It will happen despite best efforts, so it's best to have a smooth workflow for users to be notified it needs repairing and be able to then address it quickly.
The "return 200 for errors" is a bugbear of mine too, it happens far too often. There's even one vendor for whom you need to determine whether a page renders as an HTML error page or whether it's really json in the response to detect whether your auth silently failed.
100 (99 points, 7 months ago, 26 comments) https://news.ycombinator.com/item?id=47579818
This article's title could've used it to give the reader a much better impression of the subject matter.