/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: AMAuthUtils.java,v 1.8 2009/01/09 02:24:56 madan_ranganath Exp $
*
*/
/*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* This class provides utility methods to Policy and Administration console
* service to get realm qualified Authentication data.
*/
public class AMAuthUtils {
private AMAuthUtils() {
}
/**
* Returns the set of all authenticated Realm names.
*
* @param token valid user <code>SSOToken</code>
* @return Set containing String values representing Realm names.
* @throws SSOException if <code>token.getProperty()</code> fails.
*/
throws SSOException {
if (utilDebug.messageEnabled()) {
+ returnRealms);
}
return returnRealms;
}
/**
* Returns the set of all authenticated Scheme names.
*
* @param token valid user <code>SSOToken</code>
* @return Set containing String values representing Scheme names.
* @throws SSOException if <code>token.getProperty()</code> fails.
*/
throws SSOException {
}
/**
* Returns the set of all authenticated Service names.
*
* @param token valid user <code>SSOToken</code>
* @return Set containing String values representing Service names.
* @throws SSOException if <code>token.getProperty()</code> fails.
*/
throws SSOException {
}
/**
* Returns the set of all authenticated levels.
*
* @param token valid user <code>SSOToken</code>
* @return Set containing String values representing levels.
* @throws SSOException if <code>token.getProperty()</code> fails.
*/
throws SSOException {
}
/**
* Returns the set of all authenticated roles.
*
* @param token valid user {@link SSOToken}
* @return Set containing the String role names.
* @throws SSOException if {@link SSOToken#getProperty(String)} fails.
*/
}
/**
* Returns the set of all authenticated realm qualified scheme names.
*
* @param token valid user <code>SSOToken</code>
* @return Set containing String values representing
* realm qualified scheme names.
* @throws SSOException if <code>token.getProperty()</code> fails.
*/
throws SSOException {
}
/**
* Returns the set of all authenticated realm qualified service names.
*
* @param token valid user <code>SSOToken</code>
* @return Set containing String values representing
* realm qualified service names.
* @throws SSOException if <code>token.getProperty()</code> fails.
*/
throws SSOException {
}
/**
* Returns the set of all authenticated realm qualified authentication
* levels.
*
* @param token valid user <code>SSOToken</code>
* @return Set containing String values representing
* realm qualified authentication levels.
* @throws SSOException if <code>token.getProperty()</code> fails.
*/
throws SSOException {
}
/**
* Returns the given data in Realm qualified format.
*
* @param realm valid Realm
* @param data data which qualifies for Realm qualified data. This could
* be authentication scheme or authentication level or service.
* @return String representing realm qualified authentication data.
*/
}
return realmQualifedData;
}
/**
* Returns the Realm name from Realm qualified data.
*
* @param realmQualifedData Realm qualified data. This could be Realm
* qualified authentication scheme or authentication level or service.
* @return String representing realm name.
*/
if (index != -1) {
}
}
if (utilDebug.messageEnabled()) {
}
return realm;
}
/**
* Returns the data from Realm qualified data. This could be authentication
* scheme or authentication level or service.
*
* @param realmQualifedData Realm qualified data. This could be Realm
* qualified authentication scheme or authentication level or service.
* @return String representing data. This could be authentication
* scheme or authentication level or service.
*/
if (index != -1) {
} else {
}
}
if (utilDebug.messageEnabled()) {
}
return data;
}
/**
* Returns the set of all authenticated Realm names or Scheme names or
* levels or Service names.
*
* @param data Realm qualified data. This could be Realm
* qualified authentication scheme or authentication level or service.
* @param realm Boolean indicator to get Realm names if true; otherwise
* get schemes or levels or services names.
* @return the set of all authenticated Realm names or Scheme names or
* levels or Service names.
*/
while (stz.hasMoreTokens()) {
continue;
} else if (index == -1) {
continue;
}
if (realm) {
} else {
}
}
}
if (utilDebug.messageEnabled()) {
}
return returnData;
}
/**
* Returns the set of all authenticated realm qualified Scheme names or
* levels or Service names.
*
* @param data Realm qualified data. This could be Realm
* qualified authentication scheme or authentication level or service.
* @param orgDN SSOToken's org DN.
* @return the set of all authenticated realm qualified Scheme names or
* levels or Service names.
*/
returnData = new HashSet();
while (stz.hasMoreTokens()) {
if (index == -1) {
}
}
}
}
if (utilDebug.messageEnabled()) {
}
return returnData;
}
/**
* Returns a <code>Map<code> with all Auth Module instance names as key
* and the time the module was authenticated as value.
*
* @param ssoToken valid user's single sign on token.
* @return Map containing module instace auth time.
*/
if (utilDebug.messageEnabled()) {
+ssoToken.getTokenID());
}
try {
} catch (SSOException ssoExp) {
+ "Cannot get Module Auth Time from SSO Token");
}
if (utilDebug.messageEnabled()) {
"MODULE_AUTH_TIME not set in SSO Token ");
}
try {
while (tokenizer.hasMoreTokens()) {
}
} catch (SSOException ssoExp) {
}
} else {
while (tokenizer.hasMoreTokens()) {
while (elemToken.hasMoreTokens()) {
}
}
}
if (utilDebug.messageEnabled()) {
}
return moduleTimeMap;
}
/**
* Returns time at which the particular authentication occured
* @param ssoToken valid user <code>SSOToken</code>
* @param authType valid Authentication Type.
* @param authValue valid Authentication value.
* @return long value of authentication time.
*/
// Refreshing the SSOToken
try {
} catch (SSOException ssoExp) {
+ "the SSO Token");
}
long retTime = 0;
if (utilDebug.messageEnabled()) {
+ "date from getAuthInstant = " + strDate);
}
try {
+ "Cannot parse Date");
}
}
}
}
return retTime;
}
/**
* Returns the list of configured module instances that could be
* used by HTTP Basic
* @param realmName Realm Name
* @return the list of configured module instances that could be
* used by HTTP Basic
*/
//return the choice values map
return (moduleInstances);
}
List modInstances) {
try {
AMAuthenticationManager amAM = new
} catch (AMConfigurationException exp) {
+ " trying to get auth module instance names " +
"for auth type" + moduleType);
}
}
}