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

Signed-off-by: Fouad Almalki <me@fouad.io>
This commit is contained in:
Fouad Almalki 2023-12-03 08:17:46 +03:00 committed by Marek Posolda
parent c3bc43aa86
commit 0e535d2bbe
2 changed files with 2 additions and 2 deletions

View file

@ -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)) {

View file

@ -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);