Commit c18cfa16 authored by Javi Corvi's avatar Javi Corvi
Browse files

enviroment variables context path and resource url

parent 6f84345b
......@@ -58,7 +58,9 @@ import { environment } from '../environments/environment';
MatProgressBarModule,
OAuthModule.forRoot({
resourceServer: {
allowedUrls: [environment.apiUrl],
//allowedUrls: [environment.apiUrl],
allowedUrls: ["http://localhost:8090/","https://etransafe.bsc.es/"],
//allowedUrls: [window.location.protocol + '//' + window.location.hostname + '/'],
sendAccessToken: true
}
}),
......
......@@ -2,7 +2,7 @@ import {AuthConfig} from 'angular-oauth2-oidc';
import { environment } from '../environments/environment';
export const authConfig: AuthConfig = {
issuer: environment.oauth2_issuer,
redirectUri: window.location.origin,
redirectUri: window.location.origin + environment.projectContextPath,
clientId: environment.oauth2_clientId,
responseType: 'code',
strictDiscoveryDocumentValidation: false,
......
(function(window) {
window["env"] = window["env"] || {};
// Environment variables
window["env"]["projectContextPath"] = "";
window["env"]["apiUrl"] = "http://localhost:8090/pretoxapi/";
window["env"]["bratUrl"] = "http://localhost:8001";
window["env"]["debug"] = true;
......@@ -8,4 +9,5 @@
window["env"]["oauth2_issuer"] = "http://localhost:8050/auth/realms/oauth2-pretox-local";
window["env"]["oauth2_clientId"] = "pretoxtm-app";
window["env"]["oauth2_showDebugInformation"] = true;
window["env"]["oauth2_resource_server_allowed_url"] = "http://localhost:8090/";
})(this);
\ No newline at end of file
(function(window) {
window.env = window.env || {};
// Environment variables
window["env"]["projectContextPath"] = "${PROJECT_CONTEXT_PATH}";
window["env"]["apiUrl"] = "${API_URL}";
window["env"]["bratUrl"] = "${BRAT_URL}";
window["env"]["debug"] = "${DEBUG}";
......@@ -8,4 +9,5 @@
window["env"]["oauth2_issuer"] = "${OAUTH2_ISSUER}";
window["env"]["oauth2_clientId"] = "${OAUTH2_CLIENTID}";
window["env"]["oauth2_showDebugInformation"] = "${OAUTH2_DEBUG}";
window["env"]["oauth2_resource_server_allowed_url"] = "${OAUTH2_RESOURCE_SERVER_ALLOWED_URL}";
})(this);
\ No newline at end of file
export const environment = {
production: true,
//apiUrl: 'https://dev.etransafe.bsc.es/documents/',
//bratUrl: 'https://dev.etransafe.bsc.es/brat/'
projectContextPath: window["env"]["projectContextPath"] || "",
apiUrl: window["env"]["apiUrl"] || "default",
bratUrl: window["env"]["bratUrl"] || "default",
debug: window["env"]["debug"] || false,
......@@ -10,4 +9,5 @@ export const environment = {
oauth2_issuer: window["env"]["oauth2_issuer"] || "default",
oauth2_clientId: window["env"]["oauth2_clientId"] || "default",
oauth2_showDebugInformation: window["env"]["oauth2_showDebugInformation"] || false,
oauth2_resource_server_allowed_url: window["env"]["oauth2_resource_server_allowed_url"] || "default"
};
......@@ -4,13 +4,15 @@
export const environment = {
production: false,
projectContextPath:'',
apiUrl: 'http://localhost:8090/pretoxapi',
//apiUrl: 'https://etransafe.bsc.es/pretoxapi',
bratUrl: 'http://localhost:8001',
//
oauth2_issuer: 'http://localhost:8050/auth/realms/oauth2-pretox-local',
oauth2_clientId: 'pretoxtm-app',
oauth2_showDebugInformation: true
oauth2_showDebugInformation: true,
oauth2_resource_server_allowed_url: 'http://localhost:8090'
};
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment