NoSessionActivator.java revision 35ab1c5bca11317474fe12bdd8d22c17cdaf2697
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync/*
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * The contents of this file are subject to the terms of the Common Development and
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Distribution License (the License). You may not use this file except in compliance with the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * License.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * specific language governing permission and limitations under the License.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * When distributing Covered Software, include this CDDL Header Notice in each file and include
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Header, with the fields enclosed by brackets [] replaced by your own identifying
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * information: "Portions copyright [year] [name of copyright owner]".
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Copyright 2015 ForgeRock AS.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncpackage com.sun.identity.authentication.service;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncimport com.iplanet.dpro.session.service.InternalSession;
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsyncimport com.iplanet.dpro.session.service.SessionService;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync/**
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * Session activator that just destroys the old session and does not create any new session. Used for cases where
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync * OpenAM is being used for authentication only and not session management.
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync */
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsyncenum NoSessionActivator implements SessionActivator {
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync INSTANCE;
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync
930b5f872e89407f445d4000d4e4aaecaa6a0998vboxsync /**
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * Destroys the existing auth session, but does not activate any new session.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync *
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @param loginState the login state used for authentication. Unused.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @param sessionService the session service.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @param authSession the session used for authentication.
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync * @return {@code null} always
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync */
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync @Override
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync public InternalSession activateSession(final LoginState loginState, final SessionService sessionService,
3194da424708abdd288b28d96892b3a5f3f7df0bvboxsync final InternalSession authSession) {
sessionService.destroyInternalSession(authSession.getID());
return null;
}
}