TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Front end-Only-Authorization – A new web standard

43 点作者 orweis将近 2 年前

9 条评论

yamtaddle将近 2 年前
&gt; The &quot;trick&quot; is that it&#x27;s frontend-only in the same sense that Serverless has no servers.<p>Looks like it&#x27;s some kind of authorization proxy.
评论 #36139231 未加载
matlin将近 2 年前
Seems more of a generic authorization proxy rather than anything frontend related. Useful but &quot;front-end only&quot; doesn&#x27;t seem to to accurate
评论 #36139514 未加载
Semaphor将近 2 年前
So first impression: isn&#x27;t the FoAz proxy simply the backend? I apologize it that seems like a dumb question, I never used oauth or jwt.
评论 #36139111 未加载
Apreche将近 2 年前
This isn&#x27;t a new idea. This exact proxy pattern already exists with things like AWS API Gateway Lambda Authorizers.<p>This is still quite a useful architecture as it allows the backend to be implemented without concern for authentication or authorization. You just have to make absolutely sure that nobody can reach the backend except via the proxy.<p>The one downside is that it limits authorization to simple yes&#x2F;no. The user may proceed with this API call, or they may not. There are occasions where you may want to allow the API call, but alter the results based on authorization.<p>For example, a user wants to list objects, which you want to allow, but you only want the list to contain objects the user is permitted to view. In this case you can&#x27;t completely avoid implementing authorization on the backend. The proxy has to tell the backend the user&#x27;s identity, and the backend has to implement some logic based on that.
评论 #36141029 未加载
评论 #36140957 未加载
cryptonector将近 2 年前
&gt; It sure sounds like it, but no - it works, it&#x27;s easy, and it&#x27;s super safe. The &quot;trick&quot; is that it&#x27;s frontend-only in the same sense that Serverless has no servers. There is a backend component which actually enforces the access, you just don&#x27;t have to build it - FoAz is a generic backend component leveraging policy as code together with a reverse-proxy, and secrets management services to produce a one size fits all backend authorization.<p>Phew. I was about to blow a gasket.<p>So, this approach works, but generally either you build a lot of knowledge of apps&#x27; resources (URI local-parts and q-params semantics) or you have very coarse-grained authz or you restructure your applications so that a minimal authz language can represent a lot of what you&#x27;re doing using only URI local-parts.
chillbill将近 2 年前
If you don&#x27;t own the authorization backend, how can an application guarantee data safety and ownership?
评论 #36139882 未加载
TekMol将近 2 年前
IMHO the best way to do authorization if your application otherwise works completely in the frontend:<p>Rent a tiny VM for $5&#x2F;month and set up a small &quot;enter your email, you&#x27;ll get a magic link&quot; application you write in Python or PHP.<p>And proxy whatever API access you want to restrict to authorized users through a simple Python or PHP script which can just be a few lines of code. It looks up the cookie set by the magic link, checks if it is allowed to access the endpoint and if yes proxies the request.
评论 #36139333 未加载
orweis将近 2 年前
Hi HackerNews, Or from permit.io here, happy to discuss and answer questions here about the concept of FoAz and its RFC.
mildred593将近 2 年前
OAuth can already work without a backend...