Skip to content

OAuth2ClientAuthenticationToken can not deserialize #1155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
UFO233 opened this issue Apr 10, 2023 · 2 comments
Closed

OAuth2ClientAuthenticationToken can not deserialize #1155

UFO233 opened this issue Apr 10, 2023 · 2 comments
Assignees
Labels
status: duplicate A duplicate of another issue

Comments

@UFO233
Copy link

UFO233 commented Apr 10, 2023

post:/oauth2/token
java.lang.IllegalArgumentException: The class with org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientAuthenticationToken and name of org.springframework.security.oauth2.server.authorization.authentication.OAuth2ClientAuthenticationToken is not in the allowlist. If you believe this class is safe to deserialize, please provide an explicit mapping using Jackson annotations or by providing a Mixin. If the serialization is only done by a trusted source, you can also enable default typing. See spring-projects/spring-security#4370 for details.

how to solve this problem? @joshlong

@UFO233 UFO233 added the type: bug A general bug label Apr 10, 2023
@jgrandja
Copy link
Collaborator

@UFO233 Please do not double post gh-1151.

Closing this as a duplicate. See this comment for details.

@jgrandja jgrandja self-assigned this Apr 11, 2023
@jgrandja jgrandja added status: duplicate A duplicate of another issue and removed type: bug A general bug labels Apr 11, 2023
@burakbalim
Copy link

burakbalim commented Oct 6, 2023

it is not a duplicate, it is a spring-authorization-server issue, my configuration is like that

   @Bean
    public OAuth2AuthorizationService authorizationService() {
        JdbcOAuth2AuthorizationService jdbcOAuth2AuthorizationService = new JdbcOAuth2AuthorizationService(jdbcTemplate, registeredClientRepository());
        return jdbcOAuth2AuthorizationService;
    }

error position is like below --> JdbcOAuth2AuthorizationService.class

private Map<String, Object> parseMap(String data) {
			try {
				return this.objectMapper.readValue(data, new TypeReference<Map<String, Object>>() {});
			} catch (Exception ex) {
				throw new IllegalArgumentException(ex.getMessage(), ex);
			}
		}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants