Generator-jhipster: Neo4J with OAuth option not working, UserService incompatible.

Created on 11 Apr 2020  Â·  9Comments  Â·  Source: jhipster/generator-jhipster

I can generate the application with JWT and verify it. When I choose the OAuth2 option, it generates compile time errors in the user service.

JHipster Version(s)

6.8.0

JHipster configuration

{
"generator-jhipster": {
"promptValues": {
"packageName": "io.test"
},
"jhipsterVersion": "6.8.0",
"applicationType": "monolith",
"baseName": "test",
"packageName": "io.test",
"packageFolder": "io/test",
"serverPort": "8080",
"authenticationType": "oauth2",
"cacheProvider": "no",
"enableHibernateCache": false,
"websocket": false,
"databaseType": "neo4j",
"devDatabaseType": "neo4j",
"prodDatabaseType": "neo4j",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSwaggerCodegen": false,
"embeddableLaunchScript": false,
"useSass": true,
"clientPackageManager": "npm",
"clientFramework": "react",
"clientTheme": "journal",
"clientThemeVariant": "light",
"creationTimestamp": 1586628278284,
"testFrameworks": [],
"jhiPrefix": "jhi",
"entitySuffix": "",
"dtoSuffix": "DTO",
"otherModules": [],
"enableTranslation": false,
"blueprints": []
}
}

Entity configuration(s) entityName.json files generated in the .jhipster directory

No entities.

neo4j

Most helpful comment

@jhighman I made these changes in this PR: https://github.com/jhipster/generator-jhipster/pull/11571

All 9 comments

It's strange that Neo4j + JWT works for you, it shouldn't as I already saw an issue with this, about Integration Tests.
Anyway, you're probably right for OAuth2.

Don't forget Neo4j is still in beta, if you know how to fix it, your help is really welcome.

cc @atomfrede

Will check. Jwt works fine. We also tried oauth. Currently working on a performance issue for certain jdl models.

@atomfrede : not sure about Jwt+Neo4j, the last time I tried, mvn verify failed

Ah one of the tests. I thought we fixed it already. Will have look over the weekend

There are two issues, here are the fixes:
Change the line:
user.setAuthorities(authToken.getAuthorities().stream() .map(GrantedAuthority::getAuthority) .collect(Collectors.toSet()));
to this:

user.setAuthorities(authToken.getAuthorities().stream() .map(GrantedAuthority::getAuthority) .map(authority -> { Authority auth = new Authority(); auth.setName(authority); return auth; }) .collect(Collectors.toSet()));

The other issue is to add a fifth parameter to the update user method to include the imageUrl:
dateUser(String firstName, String lastName, String email, String langKey, String imageUrl)
also add a set statement:
user.setImageUrl(imageUrl);

I tested this and it works. I should note that I am testing the deployed application and ignoring the unit tests.

@jhighman I made these changes in this PR: https://github.com/jhipster/generator-jhipster/pull/11571

So the oauth probhlem is fixed with your PR @mraible (and not related to neo)?

Yes, but not all tests are passing with my PR. When they do, I think we can move WebFlux to beta.

On Apr 13, 2020, at 05:43, Frederik Hahne notifications@github.com wrote:


So the oauth probhlem is fixed with your PR @mraible (and not related to neo)?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.

I'm closing this because I believe it's fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shivroy121 picture shivroy121  Â·  3Comments

trajakovic picture trajakovic  Â·  4Comments

sdoxsee picture sdoxsee  Â·  4Comments

dronavallisaikrishna picture dronavallisaikrishna  Â·  3Comments

marcelinobadin picture marcelinobadin  Â·  3Comments