LEAuthLevelCondition.java revision e60a1cf74ca44a3bb3e3fe63b106e6ef6dca910f
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * The contents of this file are subject to the terms
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of the Common Development and Distribution License
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * (the License). You may not use this file except in
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * compliance with the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * You can obtain a copy of the License at
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * See the License for the specific language governing
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * permission and limitations under the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * When distributing Covered Code, include this CDDL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Header Notice in each file and include the License file
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * If applicable, add the following below the CDDL Header,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * with the fields enclosed by brackets [] replaced by
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * your own identifying information:
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * $Id: LEAuthLevelCondition.java,v 1.5 2008/06/25 05:43:51 qcheng Exp $
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Portions Copyright 2014 ForgeRock AS
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterimport com.sun.identity.authentication.util.AMAuthUtils;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterimport com.sun.identity.policy.interfaces.Condition;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterimport com.sun.identity.policy.ConditionDecision;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This class <code>LEAuthLevelCondition</code> is a plugin implementation
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of <code>Condition</code> interface. This condition would imply policy
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * applies if the <code>REQUEST_AUTH_LEVEL</code> is less than or equal to the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <code>AuthLevel</code> set in the Condition. <code>requestAuthLevel</code>
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * is looked up from <code>env </code> map passed in the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <code>getConditionDecision()</code> call. If it is not found in the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <code>env</code> map, <code>AuthLevel</code> is looked up from single sign on
* @deprecated Use {@link org.forgerock.openam.entitlement.conditions.environment.LEAuthLevelCondition} instead.
private int authLevelInt;
public LEAuthLevelCondition() {
throws PolicyException {
boolean allowed = false;
allowed = true;
} catch (CloneNotSupportedException e) {
throw new InternalError();
return theClone;
throw new PolicyException(
throw new PolicyException(
null);
throw new PolicyException(
throws PolicyException {
throw new PolicyException(
} catch (NumberFormatException e) {
throw new PolicyException(
throws PolicyException {
+ maxAuthLevel);
throw new PolicyException(
= AMAuthUtils.
throw new PolicyException(
return maxAuthLevel;
+ levels);
+ qualifiedLevels);
: maxAuthLevel;
return maxAuthLevel;
throws PolicyException {
throw new PolicyException(
return levelInt;