Skip to content
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

switch keycloak to v23 in test #302

Merged
merged 7 commits into from
Feb 29, 2024
Merged

Conversation

mshima
Copy link
Member

@mshima mshima commented Nov 6, 2023

No description provided.

Copy link

sonarqubecloud bot commented Nov 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.6% 1.6% Duplication

@mraible
Copy link
Contributor

mraible commented Jan 10, 2024

Closing and reopening to see if this is fixed now.

@mraible mraible closed this Jan 10, 2024
@mraible mraible reopened this Jan 10, 2024
@mraible mraible closed this Jan 24, 2024
@mraible mraible reopened this Jan 24, 2024
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
1.6% Duplication on New Code

See analysis details on SonarCloud

@mshima mshima changed the title switch keycloak to v22 in test switch keycloak to v23 in test Feb 27, 2024
@mshima
Copy link
Member Author

mshima commented Feb 27, 2024

@mraible test is relying on password grant type:

protected String getAccessToken(String username, String password) {
return given()
.contentType(ContentType.URLENC)
.formParams(Map.of(
"username", username,
"password", password,
"grant_type", "password",
"client_id", getKeycloakClientId(),
"client_secret", getKeycloakClientSecret()
))
.when()
.post(getKeycloakServerUrl() + "/protocol/openid-connect/token")
.then()
.statusCode(OK.getStatusCode())
.body("access_token", instanceOf(String.class))
.body("access_token", notNullValue())
.extract()
.path("access_token");
}

Maybe we should remove the test.

@mraible
Copy link
Contributor

mraible commented Feb 27, 2024

@mshima Yes, that test seems to be unnecessary.

@mshima mshima closed this Feb 27, 2024
@mshima mshima reopened this Feb 27, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
1.5% Duplication on New Code

See analysis details on SonarCloud

@mshima mshima marked this pull request as ready for review February 27, 2024 18:09
@mshima
Copy link
Member Author

mshima commented Feb 27, 2024

Password grant type is probably disabled at keycloak 23 by default.
That’s probably the error.

@mraible
Copy link
Contributor

mraible commented Feb 27, 2024 via email

@vishal423
Copy link
Collaborator

password grant was added specifically to run Integration (Native) tests that don't have access to UI. In absence of authentication mechanism, I doubt the integration tests can work that require user to be logged-in. Also, do note that the password grant was enabled only in the realm used by tests (we create a copy during code generation under test directory) and not enabled in the one used by application.

@mraible mraible merged commit 8a0ffdf into jhipster:main Feb 29, 2024
19 of 20 checks passed
@mshima mshima deleted the skip_ci-v8-keycloak branch June 9, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants