Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
backend API Development
nginx.conf:
- comment location /osapi
- comment location /tmf-api
- comment location /oas-api
fix auth location in nginx.conf as follows:
location /auth {
proxy_pass http://keycloak:8080/auth;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
docker-compose --profile dev down;docker-compose --profile dev up -d
Keycloak for development
Add 127.0.0.1 keycloak in your hosts file and replace http://localhost/auth/ with http://keycloak:8080/auth/ in your Keycloak config for TypeScript/Angular.
Hosts File Location:
In Linux/Unix, its location is at: /etc/hosts In windows, its location is at c:\Windows\System32\Drivers\etc\hosts.
Explanation:
The Nginx uses the http://keycloak:8080 URL which is the network inside the docker system.
The front-end (TS/Angular) uses the http://keycloak:8080
You will not get the invalid token error, as you are getting the token from http://keycloak:8080 and as well verifying with the same URL.
nginx serves already the frontend from the project org.etsi.osl.tmf.web
If you would like to use the frontend to test your backend config.prod.json should look similar to the following example
{
"TITLE": "Openslice demo",
"PORTALVERSION":"1.1.0-SNAPSHOT",
"WIKI": "http://wiki.localhost",
"BUGZILLA": "{BASEURL}/bugzilla/",
"STATUS": "http://status.localhost/",
"WEBURL": "{BASEURL}",
"PORTAL_REPO_APIURL": "{BASEURL}/osapi",
"ASSURANCE_SERVICE_MGMT_APIURL": "{BASEURL}/oas-api",
"APITMFURL": "http://localhost:13082/tmf-api",
"OAUTH_CONFIG" : {
"issuer": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/auth",
"loginUrl": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/auth",
"tokenEndpoint": "http://keycloak:8080/auth/realms/openslice/protocol/openid-connect/token",
"redirectUri": "{BASEURL}/redirect",
"logoutUrl": "{BASEURL}/auth/realms/openslice/protocol/openid-connect/logout",
"postLogoutRedirectUri": "{BASEURL}/services/services_marketplace",
"responseType": "code",
"oidc": false,
"clientId": "osapiWebClientId",
"dummyClientSecret": "secret",
"requireHttps": false,
"useHttpBasicAuth": true,
"clearHashAfterLogin": false,
"showDebugInformation": true
}
}
for the NFV frontend, config.js should be like the following:
var appConfig = angular.module('portalwebapp.config',[]);
appConfig.factory('APIEndPointService', function() {
return {
TITLE: "Openslice",
WIKI: "ROOTURL",
BUGZILLA: "ROOTURL/bugzilla/",
STATUS: "ROOTURL/status/",
APIURL: "http://localhost:13000",
WEBURL: "ROOTURL/nfvportal",
APIOAUTHURL: "http://keycloak:8080/auth/realms/openslice",
APITMFURL: "http://localhost:13082/tmf-api/serviceCatalogManagement/v4"
};
});
---
Run openslice on host
Build first
docker-compose --profile prod down;docker-compose --profile prod up -d --build