[keycloak-dev] Introducing KeycloakContext

Stian Thorgersen stian at redhat.com
Tue Mar 17 04:57:59 EDT 2015


Great, I'll get started on this once 1.2.0.Beta1 is released.

What's everyone's preference add to KeycloakSession or introduce a separate KeycloakContext?

----- Original Message -----
> From: "Bill Burke" <bburke at redhat.com>
> To: keycloak-dev at lists.jboss.org
> Sent: Friday, March 13, 2015 3:48:43 PM
> Subject: Re: [keycloak-dev] Introducing KeycloakContext
> 
> Lol!  I was thinking the same thing yesterday.  There's other things
> that need passing around too in many areas:  UserSessionModel,
> ClientSessionModel
> 
> 
> 
> On 3/13/2015 2:05 AM, Stian Thorgersen wrote:
> > Currently we pass a lot of things around. For example:
> >
> >    AuthenticationManager.logout(session, realm, userSession, uriInfo,
> >    connection)
> >    Flows.forms(session, realm, client, uriInfo)
> >
> > I propose we introduce a KeycloakContext that can hold everything. It would
> > be injectable by RestEasy:
> >
> >    @Context
> >    KeycloakContext context;
> >
> > And would look something like:
> >
> >    public interface KeycloakContext {
> >      KeycloakSession session();
> >      RealmModel realm();
> >      HttpRequest request();
> >      UriInfo uriInfo();
> >      ClientConnection clientConnection();
> >      EventBuilder event();
> >    }
> >
> > Also, I think we should convert AuthenticationManager and TokenManager into
> > providers so they can be obtained from the session rather than passing it
> > around everywhere.
> >
> > The above changes would be introduced after 1.2.0.Beta1 and can be done
> > incrementally!!
> > _______________________________________________
> > keycloak-dev mailing list
> > keycloak-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/keycloak-dev
> >
> 
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
> 


More information about the keycloak-dev mailing list