Merge pull request #13941 from prlanzarin/u24-paris-beads

chore: add legacy checkAuthorization endpoint
This commit is contained in:
Richard Alam 2021-12-16 21:51:45 -05:00 committed by GitHub
commit 0dce2d7bf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 0 deletions

View File

@ -110,6 +110,14 @@
proxy_set_header X-Original-URI $request_uri;
}
location = /bigbluebutton/connection/legacyCheckAuthorization {
internal;
proxy_pass http://127.0.0.1:8090;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
}
location = /bigbluebutton/connection/validatePad {
internal;
proxy_pass http://127.0.0.1:8090;

View File

@ -53,6 +53,26 @@ class ConnectionController {
}
}
def legacyCheckAuthorization = {
try {
def uri = request.getHeader("x-original-uri")
def sessionToken = ParamsUtil.getSessionToken(uri)
UserSession userSession = meetingService.getUserSessionWithAuthToken(sessionToken)
response.addHeader("Cache-Control", "no-cache")
response.contentType = 'plain/text'
if (userSession != null) {
response.setStatus(200)
response.outputStream << 'authorized'
} else {
response.setStatus(401)
response.outputStream << 'unauthorized'
}
} catch (IOException e) {
log.error("Error while authenticating connection.\n" + e.getMessage())
}
}
def validatePad = {
try {
String uri = request.getHeader("x-original-uri")