diff --git a/README.md b/README.md index 7bbcda9c7d8216fbeb652b9a8691dca15ab480ef..063cd0245e22e3d7092bb1ec6bfea9d3b0144b02 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Using Keycloak Authorization Services and Policy Enforcer to Protect JAX-RS Applications -In this example, we build a very simple microservice which offers one endpoints: +In this example, we build a very simple microservice which offers endpoints for: * `/accounts` +* `/account/*` These endpoints are protected and can only be accessed if a client is sending a bearer token along with the request, which must be valid (e.g.: signature, expiration and audience) and trusted by the microservice. The HTTP POST with path /accounts creates an new account. It can only run by users with admin role. @@ -27,8 +28,9 @@ To compile and run this demo you will need: Make sure that `JAVA_HOME` environment variables have been set, and that a JDK 11+ `java` command is on the path. ## Starting and Configuring the Keycloak Server ( see Part 1 ) +Note: The docu below is a little bit outdated ! - For a full Keycloak Setup read [Part 1: Keycloak Setup ](https://www.helikube.de/part-1-setup-for-keycloak-authorization-sample ) -- For a quick Keycloak setup read [Part 1: Quick Keycloak Setup via impport ]( https://www.helikube.de/part-1-quick-keycloak-setup-for-running-keycloak-authorization-sample/ ) +- For a quick Keycloak setup read [Part 1: Quick Keycloak Setup via import ]( https://www.helikube.de/part-1-quick-keycloak-setup-for-running-keycloak-authorization-sample/ ) ## Add. Info can be found at: - For Quarkus Setup read [Part 2: Quarkus Setup ]( https://www.helikube.de/part-2-running-fine-grained-keycloak-authorization-feature-with-quarkus/) @@ -45,7 +47,8 @@ live coding. To try this out: $ mvn compile quarkus:dev -Now open [OpenId Connect Dev UI](http://localhost:8080/q/dev). You will be asked to login into a _Single Page Application_. +Now open [OpenId Connect Dev UI](http://localhost:8080/q/dev). +You will be asked to login into a _Single Page Application_. - Log in as `testuser` - accessing the `/accounts` will return `200` - Log in as `testadmin` - accessing the `/accounts` will return `200` diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index cdcadc82665998841395aace4034554be8bdf4b4..791358b8aacb755978208d62ac7e8ff967eabd24 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ application.name=quarkus-keycloak-authorization-sample -application.version=0.0.7 +application.version=0.0.9 # Container Configuration settings to store images in my Github Repository quarkus.container-image.registry=ghcr.io @@ -23,7 +23,7 @@ quarkus.http.non-application-root-path=q %prod.quarkus.oidc.token.issuer=any #%prod.quarkus.container-image.name=quarkus-oidc-auth-sample-production -# mvn test activates/uses Quarkus Profile test and uses restassured to run tests. +# mvn test activates/uses Quarkus Profile test and uses restassured to run tests. # Without a port 80/8280 in our oidc.auth-server-url the underlying java program fails during connect() call # as it uses the default port of 8081. As Java is used to connect to Keycloak we cannot rely on that URI # without a port routes to port 80. So for tests we need to provide port 80 in our keycloak URL if keycloak is @@ -32,8 +32,9 @@ quarkus.http.non-application-root-path=q # For local development with docker use: # %test.quarkus.oidc.auth-server-url=http://localhost:8280/auth/realms/RBAC +%dev.quarkus.oidc.auth-server-url=http://localhost:8280/auth/realms/RBAC + -#quarkus.oidc.auth-server-url=http://localhost:8280/auth/realms/RBAC quarkus.oidc.auth-server-url=http://kube-master-h1.informatik.fh-nuernberg.de/auth/realms/RBAC quarkus.oidc.client-id=app-client quarkus.oidc.credentials.secret=0a32b2ad-7b58-4c5b-bffe-7d3673fe70a3