-
Notifications
You must be signed in to change notification settings - Fork 353
Property or field 'idToken' cannot be found on object of type 'org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser' - maybe not public or not valid? #1378
Comments
I was able to fix the 2nd issue by adding a name to the
I noticed something similar when I try to edit a post:
The method signature is:
Changing it to the following solves the problem:
Thanks to this blog post for helping me figure this out. After making these changes, I discovered a new issue. If I try to update an entity with a many-to-many relationship to another entity, it fails with:
You can see my |
I was able to fix the initial issue by removing
Should I keep this one open for the |
Could you please let me know if the original issue is native specific or also happen on the JVM with the AOT mode enabled?
Please create another issue for the |
It happens in JVM mode. I didn't test AOT-mode enabled. I can do that, as well as enter a new issue when I'm back from vacation in January. Happy holidays! |
Looks like to me you miss the |
Sorry for commenting on a closed issue, just getting back to this now. I tried with JHipster 7.6.0 today, which uses Spring Boot v2.6.3 today. I'm not sure where
I still have an issue using public ResponseEntity<?> logout(HttpServletRequest request,
@AuthenticationPrincipal(expression = "idToken") OidcIdToken idToken) { This works: public ResponseEntity<?> logout(HttpServletRequest request,
@AuthenticationPrincipal OidcUser oidcUser) {
...
OidcIdToken idToken = oidcUser.getIdToken(); Other things I noticed:
If I run the same command on an MVC app, I get a better error message:
Both projects use Mockito.
@TypeHint(
types = {
org.HdrHistogram.Histogram.class,
org.HdrHistogram.ConcurrentHistogram.class
})
spring:
...
sql:
init:
mode: never Without this change, the following error happens:
|
Hey Matt thanks for your comment, we are working with the team to provide a feedback on each point. Are points 4 and 5 native specific (do they work on the JVM) ? |
Everything is native specific. All the issues I mentioned work fine on the JVM. |
@mraible For the original issue,
Note that I had to specify the |
Thanks @eleftherias for sharing your findings. The best solution to solve this issue at the root is AOT evaluation of SpEL expression, the related issue you can follow is #167. I am letting this issue open in order to provide a feedback on the other points raised. |
Today I discovered that item 5 (JPA failing to save relationships) is a JHipster bug and is not related to Spring Native as far as I know. jhipster/generator-jhipster#17794 |
Regarding item 4 (R2DBC repositories don't work), I forgot about this in the docs:
I added
If I add Here's a PR that shows the changes I had to make. mraible/spring-native-examples#7 |
Feeback on the other points mentioned:
|
I'm trying to get a JHipster-generated Spring MVC app to work with the latest version of Spring Native. When the user tries to log out, the following error shows up in the logs and logout fails.
I tried adding a
@TypeHint
forDefaultOidcUser.class
, but that doesn't help. Here's my method signature:Another error that happens is:
The method signature for this class is:
I tried adding
org.springdoc.api.annotations.ParameterObject.class
to@TypeHints
, but that doesn't help. I also tried adding the native springdocs dependency.To reproduce this issue, perform the following steps:
When the process completes, start Keycloak and PostgreSQL:
Open a browser to
http://localhost:8080
and log in with admin/admin. Then try to log out. You'll see the first error aboutDefaultOidcUser
in the logs. Then, navigate to Entities > Post and you'll see the 2nd error./cc @joshlong
The text was updated successfully, but these errors were encountered: