Class OAuth2ResourceOwnerPasswordAuthenticationProvider
java.lang.Object
cn.herodotus.engine.oauth2.authentication.provider.AbstractAuthenticationProvider
cn.herodotus.engine.oauth2.authentication.provider.AbstractUserDetailsAuthenticationProvider
cn.herodotus.engine.oauth2.authentication.provider.OAuth2ResourceOwnerPasswordAuthenticationProvider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
public class OAuth2ResourceOwnerPasswordAuthenticationProvider
extends AbstractUserDetailsAuthenticationProvider
Description: 自定义 OAuth2 密码模式认证 Provider
- Author:
- : gengwei.zheng
- Date:
- : 2022/2/22 16:02
-
Constructor Summary
ConstructorsConstructorDescriptionOAuth2ResourceOwnerPasswordAuthenticationProvider(org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService, org.springframework.security.oauth2.server.authorization.token.OAuth2TokenGenerator<? extends org.springframework.security.oauth2.core.OAuth2Token> tokenGenerator, org.springframework.security.core.userdetails.UserDetailsService userDetailsService, OAuth2AuthenticationProperties complianceProperties) Constructs anOAuth2ClientCredentialsAuthenticationProviderusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadditionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails userDetails, Map<String, Object> additionalParameters) org.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) protected org.springframework.security.core.userdetails.UserDetailsretrieveUser(Map<String, Object> additionalParameters) voidsetSessionRegistry(org.springframework.security.core.session.SessionRegistry sessionRegistry) Sets theSessionRegistryused to track OpenID Connect sessions.booleanMethods inherited from class cn.herodotus.engine.oauth2.authentication.provider.AbstractUserDetailsAuthenticationProvider
getPasswordEncoder, getUserDetailsService, getUsernamePasswordAuthentication, setPasswordEncoderMethods inherited from class cn.herodotus.engine.oauth2.authentication.provider.AbstractAuthenticationProvider
createOAuth2AccessToken, createOAuth2AccessTokenAuthenticationToken, createOidcIdToken, creatOAuth2RefreshToken, idTokenAdditionalParameters, validateScopes
-
Constructor Details
-
OAuth2ResourceOwnerPasswordAuthenticationProvider
public OAuth2ResourceOwnerPasswordAuthenticationProvider(org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService, org.springframework.security.oauth2.server.authorization.token.OAuth2TokenGenerator<? extends org.springframework.security.oauth2.core.OAuth2Token> tokenGenerator, org.springframework.security.core.userdetails.UserDetailsService userDetailsService, OAuth2AuthenticationProperties complianceProperties) Constructs anOAuth2ClientCredentialsAuthenticationProviderusing the provided parameters.- Parameters:
authorizationService- the authorization servicetokenGenerator- – the token generator
-
-
Method Details
-
additionalAuthenticationChecks
protected void additionalAuthenticationChecks(org.springframework.security.core.userdetails.UserDetails userDetails, Map<String, Object> additionalParameters) throws org.springframework.security.core.AuthenticationException- Specified by:
additionalAuthenticationChecksin classAbstractUserDetailsAuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
retrieveUser
protected org.springframework.security.core.userdetails.UserDetails retrieveUser(Map<String, Object> additionalParameters) throws org.springframework.security.core.AuthenticationException- Specified by:
retrieveUserin classAbstractUserDetailsAuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
authenticate
public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException - Throws:
org.springframework.security.core.AuthenticationException
-
setSessionRegistry
public void setSessionRegistry(org.springframework.security.core.session.SessionRegistry sessionRegistry) Sets theSessionRegistryused to track OpenID Connect sessions.- Parameters:
sessionRegistry- theSessionRegistryused to track OpenID Connect sessions- Since:
- 1.1.1
-
supports
-