Applying the OpenID Connect specification
There are three online auction projects created to impose the OAuth2 OpenID Connect authentication scheme. All these projects use third-party tools to perform authentication and authorization procedures. The ch07g
project uses Auth0, ch07h
uses Okta, and ch07i
applies a Keycloak policy in authenticating client access to the API services. Let us first highlight Keycloak’s support for the OpenID Connect protocol.
Using HTTPBearer
The HTTPBearer
class is a utility class from the fastapi.security
module that provides an authorization scheme that relies directly on the authorization header with the Bearer
tokens. Unlike the other OAuth2 schemes, this requires the generation of an access_token
on the Keycloak side before running the authentication server. At this point, the framework has no straightforward way of accessing the credentials and the access_token
from Keycloak’s identity provider. To utilize this class, we only need...