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

Change security-openid-connect and security-openid-connect-web-authentication to dev services #928

Merged
merged 1 commit into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions security-openid-connect-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>999-SNAPSHOT</quarkus.platform.version>
<keycloak.version>13.0.0</keycloak.version>
<surefire.version>3.0.0-M5</surefire.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
Expand Down Expand Up @@ -55,9 +54,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-keycloak-server</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Configuration file

quarkus.oidc.auth-server-url=http://localhost:8180/auth/realms/quarkus
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/auth/realms/quarkus
quarkus.oidc.client-id=backend-service
quarkus.oidc.credentials.secret=secret
quarkus.keycloak.devservices.realm-path=quarkus-realm.json

# DEBUG console logging
quarkus.log.console.enable=true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.acme.security.openid.connect;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.keycloak.client.KeycloakTestClient;
import io.restassured.RestAssured;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.junit.jupiter.api.Test;

@QuarkusTest
@QuarkusTestResource(KeycloakServer.class)
public class BearerTokenAuthenticationTest {

KeycloakTestClient keycloakClient = new KeycloakTestClient();

@Test
public void testAdminAccess() {
RestAssured.given().auth().oauth2(getAccessToken("admin"))
Expand Down Expand Up @@ -37,16 +37,7 @@ public void testUserAccess() {
.statusCode(200);
}

private String getAccessToken(String userName) {
return RestAssured
.given()
.param("grant_type", "password")
.param("username", userName)
.param("password", userName)
.param("client_id", "backend-service")
.param("client_secret", "secret")
.when()
.post("http://localhost:8180/auth/realms/quarkus/protocol/openid-connect/token")
.jsonPath().get("access_token");
protected String getAccessToken(String userName) {
return keycloakClient.getAccessToken(userName);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package org.acme.security.openid.connect;

import io.quarkus.test.junit.NativeImageTest;
import io.quarkus.test.junit.QuarkusIntegrationTest;

@NativeImageTest
@QuarkusIntegrationTest
public class NativeBearerTokenAuthenticationIT extends BearerTokenAuthenticationTest {

}
7 changes: 0 additions & 7 deletions security-openid-connect-web-authentication-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>999-SNAPSHOT</quarkus.platform.version>
<keycloak.version>13.0.0</keycloak.version>
<surefire.version>3.0.0-M5</surefire.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
Expand Down Expand Up @@ -75,12 +74,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
quarkus.oidc.auth-server-url=http://localhost:8180/auth/realms/quarkus
%prod.quarkus.oidc.auth-server-url=http://localhost:8180/auth/realms/quarkus
quarkus.keycloak.devservices.realm-path=quarkus-realm.json
quarkus.oidc.client-id=frontend
quarkus.oidc.application-type=web-app
quarkus.http.auth.permission.authenticated.paths=/*
quarkus.http.auth.permission.authenticated.policy=authenticated
quarkus.log.category."com.gargoylesoftware.htmlunit.DefaultCssErrorHandler".level=ERROR
quarkus.log.category."com.gargoylesoftware.htmlunit.DefaultCssErrorHandler".level=ERROR
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.util.Cookie;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
@QuarkusTestResource(KeycloakServer.class)
public class CodeFlowTest {

@Test
Expand Down

This file was deleted.