class OAuth2ResourceOwnerPasswordAuthenticationProvider
		extends OAuth2ResourceOwnerBaseAuthenticationProvider<OAuth2ResourceOwnerPasswordAuthenticationToken> {

	private static final Logger LOGGER = LogManager.getLogger(OAuth2ResourceOwnerPasswordAuthenticationProvider.class);

	/**
	 * Constructs an {@code OAuth2AuthorizationCodeAuthenticationProvider} using the
	 * provided parameters.
	 * @param authenticationManager
	 * @param authorizationService the authorization service
	 * @param tokenGenerator the token generator
	 * @since 0.2.3
	 */
	public OAuth2ResourceOwnerPasswordAuthenticationProvider(AuthenticationManager authenticationManager,
			OAuth2AuthorizationService authorizationService,
			OAuth2TokenGenerator<? extends OAuth2Token> tokenGenerator) {
		super(authenticationManager, authorizationService, tokenGenerator);
	}

	@Override
	public UsernamePasswordAuthenticationToken buildToken(Map<String, Object> reqParameters) {<FILL_FUNCTION_BODY>}

	@Override
	public boolean supports(Class<?> authentication) {
		boolean supports = OAuth2ResourceOwnerPasswordAuthenticationToken.class.isAssignableFrom(authentication);
		LOGGER.debug("supports authentication=" + authentication + " returning " + supports);
		return supports;
	}

	@Override
	public void checkClient(RegisteredClient registeredClient) {
		assert registeredClient != null;
		if (!registeredClient.getAuthorizationGrantTypes().contains(AuthorizationGrantType.PASSWORD)) {
			throw new OAuth2AuthenticationException(OAuth2ErrorCodes.UNAUTHORIZED_CLIENT);
		}
	}

}

		String username = (String) reqParameters.get(OAuth2ParameterNames.USERNAME);
		String password = (String) reqParameters.get(OAuth2ParameterNames.PASSWORD);
		return new UsernamePasswordAuthenticationToken(username, password);
	
<methods>public void <init>(org.springframework.security.authentication.AuthenticationManager, OAuth2AuthorizationService, OAuth2TokenGenerator<? extends OAuth2Token>) ,public org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication) throws org.springframework.security.core.AuthenticationException,public abstract org.springframework.security.authentication.UsernamePasswordAuthenticationToken buildToken(Map<java.lang.String,java.lang.Object>) ,public abstract void checkClient(RegisteredClient) ,public void setRefreshTokenGenerator(Supplier<java.lang.String>) ,public abstract boolean supports(Class<?>) <variables>private static final java.lang.String ERROR_URI,private static final org.apache.logging.log4j.Logger LOGGER,private final non-sealed org.springframework.security.authentication.AuthenticationManager authenticationManager,private final non-sealed OAuth2AuthorizationService authorizationService,private final non-sealed org.springframework.context.support.MessageSourceAccessor messages,private Supplier<java.lang.String> refreshTokenGenerator,private final non-sealed OAuth2TokenGenerator<? extends OAuth2Token> tokenGenerator