Identity providers

在 Quarkus Security 框架中,身份提供者通过验证用户身份在身份验证和授权中发挥着至关重要的作用。IdentityProvider 创建一个 SecurityIdentity 实例,在用户身份验证期间使用该实例来验证和授权对 Quarkus 应用程序的访问请求。

In the Quarkus Security framework, identity providers play a crucial role in authentication and authorization by verifying user identities. IdentityProvider creates a SecurityIdentity instance, which gets used during user authentication to verify and authorize access requests to your Quarkus application.

IdentityProviderHttpAuthenticationMechanism 提供的身份验证凭据转换为 SecurityIdentity 实例。

IdentityProvider converts the authentication credentials provided by HttpAuthenticationMechanism to a SecurityIdentity instance.

某些扩展,例如 OIDCOAuth2SmallRye JWT,具有针对所支持的身份验证流程的内联 IdentityProvider 实现。例如,quarkus-oidc 使用其自身的 IdentityProvider 将标记转换为 SecurityIdentity 实例。

Some extensions, for example, OIDC, OAuth2, and SmallRye JWT, have inline IdentityProvider implementations specific to the supported authentication flow. For example, quarkus-oidc uses its own IdentityProvider to convert a token to a SecurityIdentity instance.

如果您使用基本的或基于表单的身份验证,则必须添加一个 IdentityProvider 实例将用户名和密码转换为 SecurityIdentity 实例。

If you use Basic or form-based authentication, you must add an IdentityProvider instance to convert a username and password to a SecurityIdentity instance.

若要开始使用 Quarkus 中的安全功能,请考虑将 Quarkus 内置的基本 HTTP 身份验证与 Jakarta Persistence 身份提供者相结合,以启用基于角色的访问控制 (RBAC)。

To get started with security in Quarkus, consider combining the Quarkus built-in Basic HTTP authentication with the Jakarta Persistence identity provider to enable role-based access control (RBAC).

有关基本身份验证、其机制和相关身份提供者的更多信息,请参阅以下资源:

For more information about Basic authentication, its mechanisms, and related identity providers, see the following resources: