Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds `OidcAuthorizationCodeReactiveAuthenticationManager` to authenticate request if authorization request contains the scope `openid`. Below is an example of Logto integration: - Oauth2ClientRegistration ```yaml apiVersion: oauth.halo.run/v1alpha1 kind: Oauth2ClientRegistration metadata: name: logto spec: clientAuthenticationMethod: "client_secret_basic" authorizationGrantType: "authorization_code" redirectUri: "{baseUrl}/login/oauth2/code/logto" scopes: - "profile" - "openid" authorizationUri: "https://2ri34b.logto.app/oidc/auth" tokenUri: "https://2ri34b.logto.app/oidc/token" userInfoUri: "https://2ri34b.logto.app/oidc/me" issuerUri: "https://2ri34b.logto.app/oidc" jwkSetUri: "https://2ri34b.logto.app/oidc/jwks" userInfoAuthenticationMethod: "header" userNameAttributeName: "username" clientName: "Logto" configurationMetadata: id_token_signing_alg_values_supported: - ES384 ``` > https://2ri34b.logto.app/oidc/.well-known/openid-configuration Please note that the `spec.configurationMetadata.id_token_signing_alg_values_supported` is required because Logto only uses `ES384` algorithm to sign. - AuthProvider ```yaml apiVersion: auth.halo.run/v1alpha1 kind: AuthProvider metadata: name: logto labels: auth.halo.run/auth-binding: "true" spec: displayName: Logto description: Logto is an Auth0 alternative designed for modern apps and SaaS products. It offers a seamless developer experience and is well-suited for individuals and growing companies. logo: /plugins/plugin-oauth2/assets/static/logto.svg website: https://logto.io authenticationUrl: /oauth2/authorization/logto bindingUrl: /oauth2/authorization/logto unbindUrl: /apis/uc.api.auth.halo.run/v1alpha1/user-connections/logto/disconnect authType: oauth2 settingRef: name: generic-oauth2-setting group: genericOauth configMapRef: name: oauth2-logto-config ``` /kind feature Fixes #68 ```release-note 支持 OIDC 认证协议 ```
- Loading branch information