forked from keycloak/keycloak
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Binding brokering OIDC user sessions with the issuer of the ID Token …
…to avoid looking up sessions by iterating over all brokers in a realm Closes keycloak#32091 Signed-off-by: Pedro Igor <[email protected]>
- Loading branch information
Showing
12 changed files
with
108 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
import org.keycloak.OAuthErrorException; | ||
import org.keycloak.broker.provider.BrokeredIdentityContext; | ||
import org.keycloak.broker.provider.util.SimpleHttp; | ||
import org.keycloak.common.util.Base64Url; | ||
import org.keycloak.constants.AdapterConstants; | ||
import org.keycloak.events.Details; | ||
import org.keycloak.events.Errors; | ||
|
@@ -42,6 +43,7 @@ | |
import jakarta.ws.rs.core.MultivaluedMap; | ||
import jakarta.ws.rs.core.Response; | ||
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Bill Burke</a> | ||
|
@@ -94,7 +96,7 @@ public Response backchannelLogout(String input) { | |
if (!validateAction(action)) return Response.status(400).build(); | ||
if (action.getKeycloakSessionIds() != null) { | ||
for (String sessionId : action.getKeycloakSessionIds()) { | ||
String brokerSessionId = provider.getConfig().getAlias() + "." + sessionId; | ||
String brokerSessionId = Base64Url.encode(action.getIssuer().getBytes(StandardCharsets.UTF_8)) + "." + sessionId; | ||
UserSessionModel userSession = session.sessions().getUserSessionByBrokerSessionId(realm, brokerSessionId); | ||
if (userSession != null | ||
&& userSession.getState() != UserSessionModel.State.LOGGING_OUT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.