Retrieve ClientConnection by invoking getConnection() instead of getContextObject()

Closes #25231

(cherry picked from commit 0e535d2bbe)

Signed-off-by: Fouad Almalki <me@fouad.io>
Co-authored-by: Fouad Almalki <me@fouad.io>
This commit is contained in:
Marek Posolda
2023-12-15 12:45:49 +01:00
committed by GitHub
parent eeebae650a
commit 2b0c91ab08
2 changed files with 2 additions and 2 deletions
@@ -67,7 +67,7 @@ public abstract class AbstractCibaEndpoint {
}
protected void checkSsl() {
ClientConnection clientConnection = session.getContext().getContextObject(ClientConnection.class);
ClientConnection clientConnection = session.getContext().getConnection();
RealmModel realm = session.getContext().getRealm();
if (!session.getContext().getUri().getBaseUri().getScheme().equals("https") && realm.getSslRequired().isRequired(clientConnection)) {
@@ -48,7 +48,7 @@ public abstract class AbstractParEndpoint {
}
protected void checkSsl() {
ClientConnection clientConnection = session.getContext().getContextObject(ClientConnection.class);
ClientConnection clientConnection = session.getContext().getConnection();
if (!session.getContext().getUri().getBaseUri().getScheme().equals("https") && realm.getSslRequired().isRequired(clientConnection)) {
throw new CorsErrorResponseException(cors.allowAllOrigins(), OAuthErrorException.INVALID_REQUEST, "HTTPS required", Response.Status.FORBIDDEN);