diff --git a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java index ec87b2893adb6..01c40b3308eda 100644 --- a/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java +++ b/extensions/oidc/deployment/src/main/java/io/quarkus/oidc/deployment/devservices/keycloak/KeycloakDevServicesProcessor.java @@ -546,7 +546,7 @@ private FileTime getRealmFileLastModifiedDate(Optional realm) { private void createDefaultRealm(String keycloakUrl, Map users, String oidcClientId, String oidcClientSecret) { - RealmRepresentation realm = createRealmRep(); + RealmRepresentation realm = createDefaultRealmRep(); realm.getClients().add(createClient(oidcClientId, oidcClientSecret)); for (Map.Entry entry : users.entrySet()) { @@ -637,7 +637,7 @@ private List getUserRoles(String user) { : roles; } - private RealmRepresentation createRealmRep() { + private RealmRepresentation createDefaultRealmRep() { RealmRepresentation realm = new RealmRepresentation(); realm.setRealm(getDefaultRealmName()); diff --git a/extensions/oidc/deployment/src/main/resources/dev-templates/provider.html b/extensions/oidc/deployment/src/main/resources/dev-templates/provider.html index 853e969933789..b73635a79de3f 100644 --- a/extensions/oidc/deployment/src/main/resources/dev-templates/provider.html +++ b/extensions/oidc/deployment/src/main/resources/dev-templates/provider.html @@ -117,7 +117,7 @@ } function testServiceWithAccessToken(){ - var servicePath = $('#servicePath').val(); + var servicePath = getServicePath(); $.post("testServiceWithToken", { serviceUrl: "http://localhost:" + port + servicePath, @@ -129,7 +129,7 @@ } function testServiceWithIdToken(){ - var servicePath = $('#servicePath').val(); + var servicePath = getServicePath(); $.post("testServiceWithToken", { serviceUrl: "http://localhost:" + port + servicePath, @@ -253,9 +253,23 @@ return token; } } + + function printLoginError(){ + var search = window.location.search; + var errorDescription = search.match(/error_description=([^&]+)/)[1]; + $('#errorDescription').append(""); + $('#errorDescription').append("" + "Login error: " + decodeURI(errorDescription).replaceAll("+", " ") + ""); + } + {/if} {/if} +{#if info:oidcApplicationType is 'web-app'} +function signInToService(servicePath) { + window.open("http://localhost:" + port + servicePath); +} +{/if} + {#if info:oidcGrantType is 'password'} function testServiceWithPassword(userName, password, servicePath){ @@ -394,15 +408,9 @@ $('#results').append("
"); } -function printLoginError(){ - var search = window.location.search; - var errorDescription = search.match(/error_description=([^&]+)/)[1]; - $('#errorDescription').append(""); - $('#errorDescription').append("" + "Login error: " + decodeURI(errorDescription).replaceAll("+", " ") + ""); -} - -function signInToService(servicePath) { - window.open("http://localhost:" + port + servicePath); +function getServicePath() { + var servicePath = $('#servicePath').val(); + return servicePath.startsWith("/") ? servicePath : ("/" + servicePath); } function clearResults() { @@ -607,7 +615,7 @@
Decoded
- +
{#if info:swaggerIsAvailable??} @@ -648,7 +656,7 @@
Decoded
- +
{#if info:swaggerIsAvailable??} @@ -687,7 +695,7 @@
Decoded
- +