[keycloak-dev] Introducing KeycloakContext
Marek Posolda
mposolda at redhat.com
Fri Mar 13 10:30:26 EDT 2015
+1 for KeycloakContext and especially for AuthenticationManager and
TokenManager as providers. We can also convert some static methods (like
AuthenticationManager.nextActionAfterAuthentication for instance) to
non-static so people can inject their impl of AuthenticationManager and
override if needed.
Maybe at the same time, we can also allow to pass custom Require actions
(convert RequiredAction enum to String maybe?) and pass custom
freemarker template for them? It could be the start for "interceptors"
related stuff :-)
As long as people are able to inject custom action like terms&conditions
page after first login, we should be good.
Marek
On 13.3.2015 07:05, 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
More information about the keycloak-dev
mailing list