-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathegov.html
79 lines (75 loc) · 4.52 KB
/
egov.html
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
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>eGov Demo</title>
</head>
<body>
<strong>Login als natürliche Person (LoT 1)</strong>
<br />
<a href="/prestation/1?redirectUrl=http://localhost:4200/login">eBauSO</a>
<br />
<a href="/prestation/2?redirectUrl=http://localhost:4200/login">
eBauSO - öffentliche Planauflage
</a>
<br />
<br />
<strong>Login als Firma</strong>
<br />
<a href="/prestation/3?redirectUrl=http://localhost:4200/login">eBauSO </a>
<br />
<a href="/prestation/4?redirectUrl=http://localhost:4200/login">
eBauSO - öffentliche Planauflage
</a>
<br />
<br />
<strong>Login als natürliche Person (LoT 0 - nur Planauflage)</strong>
<br />
<a href="/prestation/5?redirectUrl=http://localhost:4200/login">eBauSO</a>
<br />
<a href="/prestation/6?redirectUrl=http://localhost:4200/login">
eBauSO - öffentliche Planauflage
</a>
<script>
// The token that we return here is an encrypted and signed token
// consisting of test data and an expiry in the year 3000. The token is
// encrypted and signed with the default secrets found in the django
// settings.
//
// To take a look at the content of the tokens, decrypt the token using
// https://dinochiesa.github.io/jwt/ and decode it afterwards using
// https://jwt.io/.
//
// To modify the token, change the data in the
// `django/camac/token_exchange/management/commands/generate_dev_tokens.py`
// file, run the command and copy the new tokens from the output file into
// the variables below.
const userToken =
"eyJhbGciOiJkaXIiLCJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwidHlwIjoiSldUIn0..Vw9SGvNEGQX4YGs7LlZVvA.L-8_TeAgsn5_AZGQrc8eEB8cs9H2lJ7TX0bzHl_2CFkVGSlnwFlJ-z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hbGciOiJkaXIiLCJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwidHlwIjoiSldUIn0..CEnX9cHxzGXBUwzaLrkWCg.vXLdk1trWKyk-CIrcgVIsqdZZB9sfjEa0r_fbRbO7jDmwCxEZn1YJ91hPQ7mIaPD-9UWcB1l2clc5V9GAf5Sg058m1rXU0VavmhSuWevMiLHnlQXRufCAso8mzEmcyd4wfdlVub8yf0Vz9zxM0Xzc8-8-VivFPEItDGN8ygQxPcGXTALe9RongvgmtJOtIIrBqUbzqwcd8k9zX6iY4OVcyvn7rtltd_nsKYvY6fvSt9fynQx7cFqDALd3LemUl5SemU_zyW_1x-S6Q_Tvl1PInCJ8GH2Q6RKvyCWIDu4MpKjHX9f-lupaiV1SD5zlEcDsbxlS6cqdNSgMNM1RHWaRmg7bka8oKuqkcuAVsxFvJx0yTCKCDSoCwL7nkmDdxAfO6EGxPCkdu7UeM8PUWGC8xYbD2Z-40Vk6Z1z_Auj6QS6IzzVWyfzY_o6q8i5Ik1r.p_LQlXBotmMEvI7ph097h44FL3MRedkOILd45WSXr2w";
const mapping = {
1: (url) => `${url}?token=${userToken}`,
2: (url) => `${url}?nextURL=/public-instances&token=${userToken}`,
3: (url) => `${url}?token=${companyToken}`,
4: (url) => `${url}?nextURL=/public-instances&token=${companyToken}`,
5: (url) => `${url}?token=${userTokenLoT0}`,
6: (url) => `${url}?nextURL=/public-instances&token=${userTokenLoT0}`,
};
try {
const prestationId = parseInt(
location.pathname.match(/prestation\/(\d+)/)[1],
);
const redirectUrl = location.search.match(/redirectUrl=(.*)/)[1];
const url = mapping[prestationId](redirectUrl);
// This whole redirection logic was first implemented using NGINX only.
// However, we can't do that anymore because the portal checks the
// referer header on login which is not the right one if we simply do a
// redirect from NGINX.
location.assign(url);
} catch {}
</script>
</body>
</html>