Skip to content

Commit

Permalink
fix header doc, use ClientSessionContext, code cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Wiedemann <wistefan@googlemail.com>
  • Loading branch information
wistefan committed Apr 17, 2024
1 parent a65798d commit bbdb87f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import org.keycloak.events.Errors;
import org.keycloak.events.EventType;
import org.keycloak.models.AuthenticatedClientSessionModel;
import org.keycloak.models.ClientSessionContext;
import org.keycloak.models.KeycloakSession;
import org.keycloak.protocol.oid4vc.OID4VCClientRegistrationProvider;
import org.keycloak.protocol.oidc.utils.OAuth2Code;
import org.keycloak.protocol.oidc.utils.OAuth2CodeParser;
import org.keycloak.provider.EnvironmentDependentProviderFactory;
Expand Down Expand Up @@ -68,14 +68,10 @@ public Response process(Context context) {
Response.Status.BAD_REQUEST);
}
AuthenticatedClientSessionModel clientSession = result.getClientSession();
DefaultClientSessionContext sessionContext = DefaultClientSessionContext.fromClientSessionAndScopeParameter(clientSession,
ClientSessionContext sessionContext = DefaultClientSessionContext.fromClientSessionAndScopeParameter(clientSession,
OAuth2Constants.SCOPE_OPENID, session);


// set the client as retrieved from the pre-authorized session
session.getContext().setClient(result.getClientSession().getClient());


// set the client as retrieved from the pre-authorized session
session.getContext().setClient(result.getClientSession().getClient());

Expand Down Expand Up @@ -121,7 +117,7 @@ public EventType getEventType() {
*
* @param session - keycloak session to be used
* @param authenticatedClientSession - client session to be persisted
* @param expirationTime - expiration time of the code, the code should be short-lifed
* @param expirationTime - expiration time of the code, the code should be short-lived
* @return the pre-authorized code
*/
public static String getPreAuthorizedCode(KeycloakSession session, AuthenticatedClientSessionModel authenticatedClientSession, int expirationTime) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2016 Red Hat, Inc. and/or its affiliates
# Copyright 2024 Red Hat, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit bbdb87f

Please sign in to comment.