身份验证服务器和Web服务器之间的区别? (使用JWT)

发布于 2025-02-10 05:54:12 字数 320 浏览 3 评论 0原文

我是Web开发中整个身份验证/授权部分的新手。特别是JWT。因此,我遇到了一个中型帖子,解释了JWT的基础知识。有一个图显示了在身份验证服务器发出JWT令牌之后,Web服务器和身份验证服务器如何没有直接通信。 因此,我的3个问题是:

  1. 身份验证服务器和Web服务器有什么区别?

  2. 是身份验证服务器,数据库服务器?

  3. ,并且,由于您将从中获取用户数据(例如密码/用户名) 客户端(浏览器/用户),您将代码写入哪个服务器?身份验证还是网络? 因为nodejs/express允许您编写应用程序服务器代码吗?

I'm new to whole authentication/authorization part in web development. Specifically JWT. So I came across a medium post explaining the fundamentals of JWT. There was a diagram which showed how the web server and authentication server had no direct communication, AFTER a JWT token had been issued by the authentication server.
So, my 3 questions are:

  1. What's the difference between the authentication server and the web server?

  2. Is the authentication server, the database server?

  3. And, since you are going to take user data(e.g password/username) from the
    client(browser/user), to which server do you write the code to? authentication or web?
    Because NodeJS/Express allows you to write the app server code right?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小红帽 2025-02-17 05:54:12

1-验证服务器通常是微服务体系结构的一部分,如果您不必扩展,则可以在Web服务器中具有简单的身份验化中间件。

2-验证服务器通常是微服务体系结构的一部分,其角色是对请求进行身份验证并充当通往其余微服务的网关。

3-取决于您是否要扩展。如果您想将AUTH和其余API分开,则有多种扩展方法。

希望它有帮助=)

1 - An auth server is usually part of a microservice architecture, if you do not have to scale you can have a simple authentification middleware in your web server.

2 - The auth server is a server usually part of a microservice architecture which role is to authentificate requests and act as a gateway to the rest of the microservices.

3 - Depends if you want to scale or not. If you want to separate auth and the rest of the apis, there are multiple ways to scale.

Hope it helps =)

多情癖 2025-02-17 05:54:12

身份验证服务器和Web服务器有什么区别?

这是两个独立的服务器。两个不同的程序,有可能在两台(或更多)不同的机器上运行。具有不同的目的和责任。

是身份验证服务器,数据库服务器?

否。您所知道的,Auth Server可能根本不使用DB。例如,它可以将所有数据直接存储在文件,甚至在内存中。虽然,实际上,它背后会有一些DB。 Auth Server只是一个具有特殊目的的服务器:用户身份验证(如名称所建议)。

并且,由于您将从客户端(浏览器/用户)中获取用户数据(例如密码/用户名),因此您将代码写入哪个服务器?身份验证还是网络?因为nodejs/express允许您编写应用程序服务器代码吗?

写代码?两个都?取决于您是否自己实现Auth Server。我不确定我会得到这个问题。

关键是,应将用户凭据发送到Auth Server,并且Auth Server负责验证,安全存储和代币发行。因此,其他服务器(尤其是您称为“ Web”的服务器)不必担心。

What's the difference between the authentication server and the web server?

These are two separate servers. Two different programs, potentially running on two (or more) different machines. With different purposes and responsibilities.

Is the authentication server, the database server?

No. For all you know the auth server may not use db at all. For example it can store all the data directly in files, or even in memory. Although, in practice there will be some db behind it. Auth server is just a server with a special purpose: user authentication (as the name suggests).

And, since you are going to take user data(e.g password/username) from the client(browser/user), to which server do you write the code to? authentication or web? Because NodeJS/Express allows you to write the app server code right?

Write code? Both? Depends on whether you implement the auth server by yourself or not. I'm not sure I get that question.

The point is that user credentials should be send to the auth server and the auth server is responsible for validation, secure storage and token issuing. So that other servers (in particular the one you call "web") don't have to worry about it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文