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 branches found
No related tags found
No related merge requests found
......@@ -2,5 +2,7 @@ import { ResourceUri } from '@ngxp/rest/lib/resource.model';
export interface Environment {
production: boolean,
remoteHost: ResourceUri
remoteHost: ResourceUri,
authServier: String,
realm: String
}
\ No newline at end of file
......@@ -2,6 +2,8 @@ package de.itvsh.goofy;
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.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -11,6 +13,9 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/api/environment")
public class EnvironmentController {
@Autowired
private KeycloakSpringBootProperties kcProperties;
@Value("${goofy.production}")
private boolean production;
......@@ -19,6 +24,8 @@ public class EnvironmentController {
return FrontendEnvironment.builder()//
.production(production)//
.remoteHost(apiRoot())//
.authServer(kcProperties.getAuthServerUrl())//
.realm(kcProperties.getRealm())
.build();
}
......
......@@ -9,4 +9,6 @@ public class FrontendEnvironment {
private boolean production;
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