Skip to content

Commit 6e8e57d

Browse files
authored
Merge pull request #95 from vbelouso/oauth
feat: add external IDP integration
2 parents 12ff7e9 + 5691fc8 commit 6e8e57d

File tree

11 files changed

+1447
-70
lines changed

11 files changed

+1447
-70
lines changed

docs/authentication.md

Lines changed: 432 additions & 0 deletions
Large diffs are not rendered by default.

docs/configuration.md

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,9 @@
22

33
## Authentication
44

5-
For development a Keycloak instance will be instantiated with the users defined in the configuration.
5+
For detailed authentication configuration including OpenShift OAuth, Keycloak, and external identity providers (Google, GitHub, Azure AD), see the [Authentication Guide](./authentication.md).
66

7-
```properties
8-
%dev.quarkus.keycloak.devservices.users.joe=pass123
9-
```
10-
11-
For production the OpenShift OAuth2 provider will be used so it is required to
12-
provide the following environment variables:
13-
14-
* `OPENSHIFT_DOMAIN`: e.g. `example.openshift.com`
15-
* `OAUTH_CLIENT_SECRET`: With the secret defined for the `agent-morpheus-client` in the OpenShift cluster.
16-
17-
In the cluster you have to create an `OAuthClient` with the right redirect URLs
18-
19-
```yaml
20-
apiVersion: oauth.openshift.io/v1
21-
kind: OAuthClient
22-
metadata:
23-
name: agent-morpheus-client
24-
grantMethod: prompt
25-
secret: some-long-secret-used-by-the-oauth-client
26-
redirectURIs:
27-
- "http://agent-morpheus-client:8080"
28-
- "https://agent-morpheus-client.example.openshift.com"
29-
- "http://agent-morpheus-client.example.openshift.com"
30-
```
31-
32-
## External services (GitHub / Morpheus)
7+
## External Services (GitHub / Morpheus)
338

349
Use the `rest-client` properties for updating the default the github and morpheus RestClient endpoints:
3510

docs/development.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Configuration
44

5-
To see all the configuration options check the [configuration](./configuration.md) README.
5+
To see all the configuration options check the [configuration](./configuration.md) guide.
6+
7+
For authentication setup (Keycloak, external identity providers, testing), see the [authentication](./authentication.md) guide.
68

79
## Running the application in dev mode
810

@@ -51,6 +53,29 @@ You can create a native executable using:
5153
./mvnw package -Dnative
5254
```
5355

56+
### Build profiles
57+
58+
> **Warning**: Quarkus has build-time properties that are fixed at compile time. If you change
59+
> build-time properties in `application.properties` for a custom profile (e.g., `%external-idp`),
60+
> you must build with that profile to apply them. Runtime properties can be overridden via
61+
> `QUARKUS_PROFILE` env var at startup.
62+
63+
To build with a specific profile:
64+
65+
```shell
66+
./mvnw package -Dnative -Dquarkus.profile=external-idp
67+
```
68+
69+
Or using container build:
70+
71+
```shell
72+
# podman
73+
podman build --build-arg QUARKUS_PROFILE=external-idp -f src/main/docker/Dockerfile.multi-stage .
74+
75+
# docker
76+
docker build --build-arg QUARKUS_PROFILE=external-idp -f src/main/docker/Dockerfile.multi-stage .
77+
```
78+
5479
Or, if you don't have GraalVM installed, you can run the native executable build in a container using:
5580

5681
```shell
@@ -59,6 +84,20 @@ Or, if you don't have GraalVM installed, you can run the native executable build
5984

6085
You can then execute your native executable with: `./target/agent-morpheus-client-1.0.0-SNAPSHOT-runner`
6186

87+
### Building with profiles
88+
89+
Some Quarkus properties are **build-time only** and cannot be changed at runtime. When building for a specific deployment target, include the profile:
90+
91+
```shell
92+
# For external-idp deployments (Keycloak, Google, etc.)
93+
./mvnw package -Dnative -Dquarkus.profile=external-idp
94+
95+
# For prod deployments (OpenShift OAuth) - default
96+
./mvnw package -Dnative
97+
```
98+
99+
**Important:** The CI/CD pipeline builds a universal image without a specific profile. Runtime profile selection via `QUARKUS_PROFILE` works for most configurations, but build-time properties (like `@IfBuildProfile` annotations) are fixed at compile time.
100+
62101
If you want to learn more about building native executables, please consult <https://quarkus.io/guides/maven-tooling>.
63102

64103
## Related Guides

0 commit comments

Comments
 (0)