Skip to content
Snippets Groups Projects
Commit 3a6b8a1f authored by OZGCloud's avatar OZGCloud
Browse files

OZG-164 OZG-216 extend environment with settings for keycloak

parent 116f738f
No related merge requests found
...@@ -2,5 +2,7 @@ import { ResourceUri } from '@ngxp/rest/lib/resource.model'; ...@@ -2,5 +2,7 @@ import { ResourceUri } from '@ngxp/rest/lib/resource.model';
export interface Environment { export interface Environment {
production: boolean, production: boolean,
remoteHost: ResourceUri remoteHost: ResourceUri,
authServier: String,
realm: String
} }
\ No newline at end of file
...@@ -2,6 +2,8 @@ package de.itvsh.goofy; ...@@ -2,6 +2,8 @@ package de.itvsh.goofy;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*; import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*;
import org.keycloak.adapters.springboot.KeycloakSpringBootProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -11,6 +13,9 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -11,6 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/environment") @RequestMapping("/api/environment")
public class EnvironmentController { public class EnvironmentController {
@Autowired
private KeycloakSpringBootProperties kcProperties;
@Value("${goofy.production}") @Value("${goofy.production}")
private boolean production; private boolean production;
...@@ -19,6 +24,8 @@ public class EnvironmentController { ...@@ -19,6 +24,8 @@ public class EnvironmentController {
return FrontendEnvironment.builder()// return FrontendEnvironment.builder()//
.production(production)// .production(production)//
.remoteHost(apiRoot())// .remoteHost(apiRoot())//
.authServer(kcProperties.getAuthServerUrl())//
.realm(kcProperties.getRealm())
.build(); .build();
} }
......
...@@ -9,4 +9,6 @@ public class FrontendEnvironment { ...@@ -9,4 +9,6 @@ public class FrontendEnvironment {
private boolean production; private boolean production;
private String remoteHost; private String remoteHost;
private String authServer;
private String realm;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment