Skip to content

There is a bug in the JPA usage guide code provided #697

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
byte-marvel opened this issue Apr 21, 2022 · 1 comment
Closed

There is a bug in the JPA usage guide code provided #697

byte-marvel opened this issue Apr 21, 2022 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@byte-marvel
Copy link

Describe the bug

When converting objects, scopes are lost, resulting in the failure of the oidc client to obtain user information

Code location:docs/modules/guides/examples[JpaOAuth2AuthorizationService.toObject()]

To Reproduce

Directly use the given JPA integration code to integrate the client oidc. After successful authentication, insufficient appears when obtaining user information_ Scope error

Expected behavior

if (entity.getAccessTokenValue() != null) {
OAuth2AccessToken accessToken = new OAuth2AccessToken(
OAuth2AccessToken.TokenType.BEARER,
entity.getAccessTokenValue(),
entity.getAccessTokenIssuedAt(),
entity.getAccessTokenExpiresAt(),
### Sets.newHashSet(entity.getAccessTokenScopes().split(",")));
builder.token(accessToken, metadata -> metadata.putAll(parseMap(entity.getAccessTokenMetadata())));
}

@byte-marvel byte-marvel added the type: bug A general bug label Apr 21, 2022
@sjohnr sjohnr closed this as completed in 51de75b Apr 21, 2022
@sjohnr
Copy link
Contributor

sjohnr commented Apr 21, 2022

Thanks @bit-star! If I get some time, I'll have to enhance the tests a bit to catch issues like that. For now, I pushed a fix so you can try it out.

@jgrandja jgrandja added this to the 0.3.0 milestone Apr 22, 2022
doba16 pushed a commit to doba16/spring-authorization-server that referenced this issue Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants