From 70392d9f1a1a1696faddb12f15ba15c78bdcbbff Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Mon, 9 Jun 2014 14:53:14 -0400 Subject: [PATCH 1/2] KEYCLOAK-522 Refactor Undertow Adapter so that it can optionally be used without the Servlet API. --- .../undertow/ServletKeycloakAuthMech.java | 38 +++----------- .../undertow/ServletRequestAuthenticator.java | 12 +++-- .../UndertowAuthenticatedActionsHandler.java | 3 +- .../undertow/UndertowKeycloakAuthMech.java | 52 +++++++++++++++++++ .../UndertowRequestAuthenticator.java | 46 ++++++++++++++-- 5 files changed, 111 insertions(+), 40 deletions(-) create mode 100644 integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java index 26a735f76a42..0923d2e6fdac 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java @@ -1,21 +1,18 @@ package org.keycloak.adapters.undertow; -import io.undertow.security.api.AuthenticationMechanism; import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; import io.undertow.servlet.api.ConfidentialPortManager; -import io.undertow.util.AttachmentKey; import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.AuthChallenge; -import org.keycloak.adapters.AuthOutcome; import org.keycloak.adapters.KeycloakDeployment; +import org.keycloak.adapters.RequestAuthenticator; /** * @author Bill Burke + * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. * @version $Revision: 1 $ */ -public class ServletKeycloakAuthMech implements AuthenticationMechanism { - public static final AttachmentKey KEYCLOAK_CHALLENGE_ATTACHMENT_KEY = AttachmentKey.create(AuthChallenge.class); +public class ServletKeycloakAuthMech extends UndertowKeycloakAuthMech { protected AdapterDeploymentContext deploymentContext; protected UndertowUserSessionManagement userSessionManagement; @@ -34,23 +31,13 @@ public AuthenticationMechanismOutcome authenticate(HttpServerExchange exchange, if (!deployment.isConfigured()) { return AuthenticationMechanismOutcome.NOT_ATTEMPTED; } - ServletRequestAuthenticator authenticator = createRequestAuthenticator(deployment, exchange, securityContext, facade); - AuthOutcome outcome = authenticator.authenticate(); - if (outcome == AuthOutcome.AUTHENTICATED) { - return AuthenticationMechanismOutcome.AUTHENTICATED; - } - AuthChallenge challenge = authenticator.getChallenge(); - if (challenge != null) { - exchange.putAttachment(KEYCLOAK_CHALLENGE_ATTACHMENT_KEY, challenge); - } - if (outcome == AuthOutcome.FAILED) { - return AuthenticationMechanismOutcome.NOT_AUTHENTICATED; - } - return AuthenticationMechanismOutcome.NOT_ATTEMPTED; + RequestAuthenticator authenticator = createRequestAuthenticator(deployment, exchange, securityContext, facade); + + return super.keycloakAuthenticate(exchange, authenticator); } - protected ServletRequestAuthenticator createRequestAuthenticator(KeycloakDeployment deployment, HttpServerExchange exchange, SecurityContext securityContext, UndertowHttpFacade facade) { + protected RequestAuthenticator createRequestAuthenticator(KeycloakDeployment deployment, HttpServerExchange exchange, SecurityContext securityContext, UndertowHttpFacade facade) { int confidentialPort = getConfidentilPort(exchange); return new ServletRequestAuthenticator(facade, deployment, @@ -67,15 +54,4 @@ protected int getConfidentilPort(HttpServerExchange exchange) { return confidentialPort; } - @Override - public ChallengeResult sendChallenge(HttpServerExchange exchange, SecurityContext securityContext) { - AuthChallenge challenge = exchange.getAttachment(KEYCLOAK_CHALLENGE_ATTACHMENT_KEY); - if (challenge != null) { - UndertowHttpFacade facade = new UndertowHttpFacade(exchange); - if (challenge.challenge(facade)) { - return new ChallengeResult(true, exchange.getResponseCode()); - } - } - return new ChallengeResult(false); - } } diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java index 139683abc2e7..546e126bc27c 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java @@ -10,20 +10,21 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.keycloak.KeycloakPrincipal; +import org.keycloak.adapters.RefreshableKeycloakSecurityContext; /** * @author Bill Burke + * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. * @version $Revision: 1 $ */ public class ServletRequestAuthenticator extends UndertowRequestAuthenticator { - protected UndertowUserSessionManagement userSessionManagement; public ServletRequestAuthenticator(HttpFacade facade, KeycloakDeployment deployment, int sslRedirectPort, SecurityContext securityContext, HttpServerExchange exchange, UndertowUserSessionManagement userSessionManagement) { - super(facade, deployment, sslRedirectPort, securityContext, exchange); - this.userSessionManagement = userSessionManagement; + super(facade, deployment, sslRedirectPort, securityContext, exchange, userSessionManagement); } @Override @@ -69,4 +70,9 @@ protected void login(KeycloakAccount account) { userSessionManagement.login(servletRequestContext.getDeployment().getSessionManager(), session.getId(), account.getPrincipal().getName(), account.getKeycloakSecurityContext().getToken().getSessionState()); } + + @Override + protected KeycloakUndertowAccount createAccount(KeycloakPrincipal principal, RefreshableKeycloakSecurityContext session) { + return new KeycloakUndertowAccount(principal, session, deployment); + } } diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java index 294daee208f7..dbb7478124db 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java @@ -12,6 +12,7 @@ * Bridge for authenticated Keycloak adapter actions * * @author Bill Burke + * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. * @version $Revision: 1 $ */ public class UndertowAuthenticatedActionsHandler implements HttpHandler { @@ -33,7 +34,7 @@ public HttpHandler wrap(HttpHandler handler) { } - protected UndertowAuthenticatedActionsHandler(AdapterDeploymentContext deploymentContext, HttpHandler next) { + public UndertowAuthenticatedActionsHandler(AdapterDeploymentContext deploymentContext, HttpHandler next) { this.deploymentContext = deploymentContext; this.next = next; } diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java new file mode 100644 index 000000000000..00319c743982 --- /dev/null +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java @@ -0,0 +1,52 @@ +package org.keycloak.adapters.undertow; + +import io.undertow.security.api.AuthenticationMechanism; +import io.undertow.security.api.SecurityContext; +import io.undertow.server.HttpServerExchange; +import io.undertow.util.AttachmentKey; +import org.keycloak.adapters.AuthChallenge; +import org.keycloak.adapters.AuthOutcome; +import org.keycloak.adapters.RequestAuthenticator; +import static org.keycloak.adapters.undertow.ServletKeycloakAuthMech.KEYCLOAK_CHALLENGE_ATTACHMENT_KEY; + +/** + * Abstract base class for a Keycloak-enabled Undertow AuthenticationMechanism. + * + * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. + */ +public abstract class UndertowKeycloakAuthMech implements AuthenticationMechanism { + public static final AttachmentKey KEYCLOAK_CHALLENGE_ATTACHMENT_KEY = AttachmentKey.create(AuthChallenge.class); + + @Override + public ChallengeResult sendChallenge(HttpServerExchange exchange, SecurityContext securityContext) { + AuthChallenge challenge = exchange.getAttachment(KEYCLOAK_CHALLENGE_ATTACHMENT_KEY); + if (challenge != null) { + UndertowHttpFacade facade = new UndertowHttpFacade(exchange); + if (challenge.challenge(facade)) { + return new ChallengeResult(true, exchange.getResponseCode()); + } + } + return new ChallengeResult(false); + } + + /** + * Call this inside your authenticate method. + */ + protected AuthenticationMechanismOutcome keycloakAuthenticate(HttpServerExchange exchange, RequestAuthenticator authenticator) { + AuthOutcome outcome = authenticator.authenticate(); + if (outcome == AuthOutcome.AUTHENTICATED) { + return AuthenticationMechanismOutcome.AUTHENTICATED; + } + AuthChallenge challenge = authenticator.getChallenge(); + if (challenge != null) { + exchange.putAttachment(KEYCLOAK_CHALLENGE_ATTACHMENT_KEY, challenge); + } + + if (outcome == AuthOutcome.FAILED) { + return AuthenticationMechanismOutcome.NOT_AUTHENTICATED; + } + + return AuthenticationMechanismOutcome.NOT_ATTEMPTED; + } + +} \ No newline at end of file diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java index cd5fdaa4bcd5..c3b0ea4a205a 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java @@ -2,6 +2,8 @@ import io.undertow.security.api.SecurityContext; import io.undertow.server.HttpServerExchange; +import io.undertow.server.session.Session; +import io.undertow.util.Sessions; import org.keycloak.KeycloakPrincipal; import org.keycloak.adapters.HttpFacade; import org.keycloak.adapters.KeycloakAccount; @@ -12,17 +14,22 @@ /** * @author Bill Burke + * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. * @version $Revision: 1 $ */ -public class UndertowRequestAuthenticator extends RequestAuthenticator { +public abstract class UndertowRequestAuthenticator extends RequestAuthenticator { protected SecurityContext securityContext; protected HttpServerExchange exchange; + protected UndertowUserSessionManagement userSessionManagement; - public UndertowRequestAuthenticator(HttpFacade facade, KeycloakDeployment deployment, int sslRedirectPort, SecurityContext securityContext, HttpServerExchange exchange) { + public UndertowRequestAuthenticator(HttpFacade facade, KeycloakDeployment deployment, int sslRedirectPort, + SecurityContext securityContext, HttpServerExchange exchange, + UndertowUserSessionManagement userSessionManagement) { super(facade, deployment, sslRedirectPort); this.securityContext = securityContext; this.exchange = exchange; + this.userSessionManagement = userSessionManagement; } protected void propagateKeycloakContext(KeycloakUndertowAccount account) { @@ -41,26 +48,55 @@ protected void saveRequest() { @Override protected void completeOAuthAuthentication(KeycloakPrincipal principal, RefreshableKeycloakSecurityContext session) { - KeycloakUndertowAccount account = new KeycloakUndertowAccount(principal, session, deployment); + KeycloakUndertowAccount account = createAccount(principal, session); securityContext.authenticationComplete(account, "KEYCLOAK", false); propagateKeycloakContext(account); login(account); } protected void login(KeycloakAccount account) { - + Session session = Sessions.getOrCreateSession(exchange); + session.setAttribute(KeycloakUndertowAccount.class.getName(), account); + String username = account.getPrincipal().getName(); + String keycloakSessionId = account.getKeycloakSecurityContext().getToken().getSessionState(); + userSessionManagement.login(session.getSessionManager(), session.getId(), username, keycloakSessionId); } @Override protected void completeBearerAuthentication(KeycloakPrincipal principal, RefreshableKeycloakSecurityContext session) { - KeycloakUndertowAccount account = new KeycloakUndertowAccount(principal, session, deployment); + KeycloakUndertowAccount account = createAccount(principal, session); securityContext.authenticationComplete(account, "KEYCLOAK", false); propagateKeycloakContext(account); } @Override protected boolean isCached() { + Session session = Sessions.getSession(exchange); + if (session == null) { + log.info("session was null, returning null"); + return false; + } + KeycloakUndertowAccount account = (KeycloakUndertowAccount)session.getAttribute(KeycloakUndertowAccount.class.getName()); + if (account == null) { + log.info("Account was not in session, returning null"); + return false; + } + account.setDeployment(deployment); + if (account.isActive()) { + log.info("Cached account found"); + securityContext.authenticationComplete(account, "KEYCLOAK", false); + propagateKeycloakContext( account); + return true; + } + log.info("Account was not active, returning false"); + session.removeAttribute(KeycloakUndertowAccount.class.getName()); return false; } + + /** + * Subclasses need to be able to create their own version of the KeycloakUndertowAccount + * @return The account + */ + protected abstract KeycloakUndertowAccount createAccount(KeycloakPrincipal principal, RefreshableKeycloakSecurityContext session); } From 4e9bec69e429b497dfbf9f3f66d7c67e2743aefb Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Mon, 9 Jun 2014 16:43:07 -0400 Subject: [PATCH 2/2] Add Apache 2.0 license --- .../adapters/undertow/KeycloakChallenge.java | 16 ++++++++++++++++ .../undertow/KeycloakServletExtension.java | 16 ++++++++++++++++ .../undertow/KeycloakUndertowAccount.java | 16 ++++++++++++++++ .../undertow/ServletKeycloakAuthMech.java | 16 ++++++++++++++++ .../undertow/ServletPreAuthActionsHandler.java | 16 ++++++++++++++++ .../undertow/ServletRequestAuthenticator.java | 16 ++++++++++++++++ .../undertow/SessionManagementBridge.java | 16 ++++++++++++++++ .../UndertowAuthenticatedActionsHandler.java | 16 ++++++++++++++++ .../adapters/undertow/UndertowHttpFacade.java | 16 ++++++++++++++++ .../undertow/UndertowKeycloakAuthMech.java | 16 ++++++++++++++++ .../undertow/UndertowRequestAuthenticator.java | 16 ++++++++++++++++ .../undertow/UndertowUserSessionManagement.java | 16 ++++++++++++++++ 12 files changed, 192 insertions(+) diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakChallenge.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakChallenge.java index 6e77c8985a1b..7e8aa2cb5429 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakChallenge.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakChallenge.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.api.AuthenticationMechanism; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java index 648be58232ac..88ae3c2a9a2e 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakServletExtension.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.api.AuthenticationMechanism; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakUndertowAccount.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakUndertowAccount.java index be721845fb66..bc080f9782a5 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakUndertowAccount.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/KeycloakUndertowAccount.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.idm.Account; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java index 0923d2e6fdac..d43adbfcd3f0 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletKeycloakAuthMech.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.api.SecurityContext; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletPreAuthActionsHandler.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletPreAuthActionsHandler.java index 96d9db0993bf..0f20afaeb11c 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletPreAuthActionsHandler.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletPreAuthActionsHandler.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.server.HandlerWrapper; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java index 546e126bc27c..6635d3468781 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/ServletRequestAuthenticator.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.api.SecurityContext; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java index 11682f02461d..0bdd4348915e 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/SessionManagementBridge.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.server.session.SessionManager; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java index dbb7478124db..7fb60464fd95 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowAuthenticatedActionsHandler.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.server.HandlerWrapper; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowHttpFacade.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowHttpFacade.java index 942612835674..308233fd66d4 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowHttpFacade.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowHttpFacade.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.server.HttpServerExchange; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java index 00319c743982..b650f6dcf0f2 100644 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowKeycloakAuthMech.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.api.AuthenticationMechanism; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java index c3b0ea4a205a..67a7b7a12a74 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowRequestAuthenticator.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.api.SecurityContext; diff --git a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java index f9df4b05c368..a70eac42fab2 100755 --- a/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java +++ b/integration/undertow/src/main/java/org/keycloak/adapters/undertow/UndertowUserSessionManagement.java @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors + * as indicated by the @author tags. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ package org.keycloak.adapters.undertow; import io.undertow.security.api.AuthenticatedSessionManager;