All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stormpath.sdk.servlet.mvc.SamlLogoutController Maven / Gradle / Ivy

Go to download

Servlet-specific additions allowing one to more easily deploy the Stormpath SDK in a servlet-container-based web application.

The newest version!
/*
 * Copyright 2015 Stormpath, Inc.
 *
 * 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 com.stormpath.sdk.servlet.mvc;

import com.stormpath.sdk.lang.Assert;
import com.stormpath.sdk.servlet.filter.ServerUriResolver;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SamlLogoutController extends LogoutController {

    private ServerUriResolver serverUriResolver;
    private String resultUri;
    // not implemented yet
    // private Resolver samlOrganizationResolver;

    public void setServerUriResolver(ServerUriResolver serverUriResolver) {
        this.serverUriResolver = serverUriResolver;
    }

    public void setResultUri(String resultUri) {
        this.resultUri = resultUri;
    }

    /*
    // not implemented yet
    public void setSamlOrganizationResolver(Resolver SamlOrganizationResolver) {
        this.samlOrganizationResolver = samlOrganizationResolver;
    }
    */

    @Override
    public void init() {
        Assert.notNull(serverUriResolver, "serverUriResolver must be configured.");
        Assert.hasText(resultUri, "resultUri must be configured.");
        //not implemented yet
        //controller.setSamlOrganizationResolver(idSiteOrganizationResolver);
        super.init();
    }

    @Override
    public boolean isNotAllowedIfAuthenticated() {
        return false;
    }

    @Override
    public ViewModel handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        //ensure the local application user state is cleared no matter what:
        ViewModel vm = super.handleRequest(request, response);

        //not dealing with SAML SSO logout right now.
        return vm;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy