001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.shiro.cas;
020
021import org.apache.shiro.authc.RememberMeAuthenticationToken;
022
023/**
024 * This class represents a token for a CAS authentication (service ticket + user id + remember me).
025 *
026 * @since 1.2
027 * @see <a href="https://github.com/bujiio/buji-pac4j">buji-pac4j</a>
028 * @deprecated replaced with Shiro integration in <a href="https://github.com/bujiio/buji-pac4j">buji-pac4j</a>.
029 */
030@Deprecated
031public class CasToken implements RememberMeAuthenticationToken {
032    
033    private static final long serialVersionUID = 8587329689973009598L;
034    
035    // the service ticket returned by the CAS server
036    private String ticket = null;
037    
038    // the user identifier
039    private String userId = null;
040    
041    // is the user in a remember me mode ?
042    private boolean isRememberMe = false;
043    
044    public CasToken(String ticket) {
045        this.ticket = ticket;
046    }
047    
048    public Object getPrincipal() {
049        return userId;
050    }
051    
052    public Object getCredentials() {
053        return ticket;
054    }
055    
056    public void setUserId(String userId) {
057        this.userId = userId;
058    }
059    
060    public boolean isRememberMe() {
061        return isRememberMe;
062    }
063    
064    public void setRememberMe(boolean isRememberMe) {
065        this.isRememberMe = isRememberMe;
066    }
067}