Serve universis auth under different application context
Description
Is it possible to serve application under different context than root e.g. /auth/ ?
Solution
The first approach uses proxy server -if exists- to serve auth server under different application context.
nginx
- Configure nginx to proxy auth server:
...
location /auth/ {
proxy_pass http://127.0.0.1:3000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
...
Be careful with the trailing slash at the end of proxy_pass setting.
After applying the previous configuration auth server will be available under https://<server>/auth/
.
- Configure auth server -app.development.json or app.production.json-. Define application context by
settings/app/base
attribute
"settings": {
"app": {
...
"base": "/auth/"
},
...
- Build and restart auth server.
After this change client applications -and universis api server also- should use auth server application context e.g. universis-students should configure and use new auth server endpoints
"auth": {
"authorizeURL":"https://<auth server>/auth/authorize",
"logoutURL":"https://<auth server>/auth/logout?continue=http://localhost:7001/",
"userProfileURL":"https://<api server>/api/users/me",
"oauth2": {
"tokenURL": "https://<auth server>/auth/tokeninfo",
"clientID": "6065706863394382",
"callbackURL": "http://localhost:7001/auth/callback/",
"scope": [
"students"
]
}
}
Read more about serving client applications like universis-students in different application context here Serve universis students under different application context
Edited by Kyriakos Barbounakis