public class AMAuthConfigUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_NAME |
protected static String |
ATTR_VALUE_NODE |
protected static String |
ATTR_VALUE_PAIR_NODE |
protected static String |
bundleName |
protected static String |
CLIENT_KEY |
protected static String |
MODULE_KEY |
protected static String |
NAMED_CONFIGURATION |
protected static String |
NAMED_CONFIGURATION_ID |
protected static String |
ORG_KEY |
protected static String |
ROLE_KEY |
protected static String |
SERVICE_KEY |
protected static String |
SERVICE_NAME |
protected static String |
SERVICE_VERSION |
protected static String |
USER_KEY |
Constructor and Description |
---|
AMAuthConfigUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
authConfigurationEntryToXMLString(List entries)
Converts a List of
AuthConfigurationEntry to XML
representation according to following DTD. |
static String |
convertToXMLString(List configs)
Converts a List of authentication configuration to XML string
representation according to following DTD.
|
static void |
createNamedConfig(String configName,
int priority,
Map attributeDataMap,
String orgName,
SSOToken token)
Creates an authentication configuration in
iPlanetAMAuthConfiguration service. |
static Map |
getAllAuthModules(SSOToken token)
Returns all supported authentication modules
|
static Map |
getAllAuthModules(String orgDN,
SSOToken token)
Returns all supported authentication modules in an Organization
If there are not modules configured at the Organization level
then the authentication modules set at Global level will be returned.
|
static Set |
getAllNamedConfig(String orgName,
SSOToken token)
Returns all the authentication configurations defined in
iPlanetAMAuthConfiguration service. |
static String |
getAuthConfigName(AuthContext.IndexType indexType,
String indexName,
String organizationDN,
String clientType)
Returns the authentication configuration name given the
AuthContext.IndexType and indexName . |
static String |
getAuthConfigName(String organizationDN,
String clientType)
Returns the authentication configuration name for the organization based
authentication.
|
static String |
getAuthLevelAttribute(Map attrs,
String module)
Returns authentication level attribute name for module name.
|
static String |
getControlFlagAsString(AppConfigurationEntry.LoginModuleControlFlag controlFlag)
Get the string representation of the
AppConfigurationEntry.LoginModuleControlFlag . |
static Set |
getGlobalAuthenticators(SSOToken token)
Returns the global authenticators.
|
static String |
getModuleName(String className)
Returns module name from complete class name.
|
static String |
getModuleServiceName(String module)
Returns SM service name based on module name
|
static Map<String,Set<String>> |
getNamedConfig(String configName,
String orgName,
SSOToken token)
Returns the authentication configuration defined in
iPlanetAMAuthConfiguration service as XML string. |
static String |
getNewModuleServiceName(String module) |
static ServiceSchema |
getServiceSchema(SSOToken token)
Returns service schema object for the authentication configuration
subschema.
|
static AppConfigurationEntry[] |
parseValues(String xmlValue)
Parses the string value for the authentication configuration
based on the attribute DTD and return an array of
AppConfigurationEntry which could be used to retrieve
module name, flag and options. |
static void |
removeNamedConfig(String configName,
String orgName,
SSOToken token)
Removes an authentication configuration defined in
iPlanetAMAuthConfiguration service. |
static void |
replaceNamedConfig(String configName,
int priority,
Map attributeDataMap,
String orgName,
SSOToken token)
Replaces an existing authentication configuration defined in
iPlanetAMAuthConfiguration service. |
static List |
xmlToAuthConfigurationEntry(String xmlValue)
Parses the string value for the authentication configuration
based on the attribute DTD and return a List of
AuthConfigurationEntry which could be used to retrieve
module name, flag and options. |
protected static final String SERVICE_NAME
protected static final String NAMED_CONFIGURATION
protected static final String NAMED_CONFIGURATION_ID
protected static final String SERVICE_VERSION
protected static final String ATTR_VALUE_PAIR_NODE
protected static final String ATTR_VALUE_NODE
public static final String ATTR_NAME
protected static final String MODULE_KEY
protected static final String USER_KEY
protected static final String ORG_KEY
protected static final String SERVICE_KEY
protected static final String ROLE_KEY
protected static final String CLIENT_KEY
protected static String bundleName
public static AppConfigurationEntry[] parseValues(String xmlValue)
AppConfigurationEntry
which could be used to retrieve
module name, flag and options. Empty array of
AppConfigurationEntry
will be returned if the XML value
could not be parsed.xmlValue
- XML string value for the authentication configuration.AppConfigurationEntry
each contains module
name, flag and options.public static String getAuthConfigName(AuthContext.IndexType indexType, String indexName, String organizationDN, String clientType) throws AMConfigurationException
AuthContext.IndexType
and indexName
. The
authentication configuration name will be used as the
configName
for getAppConfigurationEntry()
function in AMConfiguration
.indexType
- The AuthContext.IndexType
, one of the
following values:
AuthContext.IndexType.MODULE_INSTANCE
,
AuthContext.IndexType.SERVICE
,
AuthContext.IndexType.ROLE
or
AuthContext.IndexType.USER
.indexName
- The corresponding index value for the
IndexType
, for ROLE
and
USER
, DNs must be passed in.organizationDN
- DN for the login organization.clientType
- Client type, example genericHTML
.AMConfigurationException
- if indexType
is not
supported.public static String getAuthConfigName(String organizationDN, String clientType)
configName
for getAppConfigurationEntry()
.
function in AMConfiguration
.organizationDN
- DN for the login organization.clientType
- public static String convertToXMLString(List configs)
<!-- AttributeValuePair defines the values used to specify authentication configuration information. --> <!ELEMENT AttributeValuePair (Value*) > <!-- Value defines one authentication configuration --> <!ELEMENT Value (#PCDATA) >
configs
- List of configurations to be processed, each value
consists of following parts separated by blank space:
module_name
flag option1
,
option2
.public static void createNamedConfig(String configName, int priority, Map attributeDataMap, String orgName, SSOToken token) throws SMSException, SSOException, AMConfigurationException
iPlanetAMAuthConfiguration
service. This method will be
used by console to manage configurations for different services.configName
- Name of the authentication configuration.priority
- Priority of this authentication configuration.attributeDataMap
- Map of authentication service attributes.orgName
- Organization DN.token
- Single sign on token.SMSException
- if failed to store the configuration because
of SM Exception.SSOException
- if single sign on token is not valid.AMConfigurationException
- if the configName
is null.public static void replaceNamedConfig(String configName, int priority, Map attributeDataMap, String orgName, SSOToken token) throws SMSException, SSOException, AMConfigurationException
iPlanetAMAuthConfiguration
service. This method will be
used by console to manage configurations for different services.configName
- Name of the authentication configuration.priority
- Priority of the configuration.attributeDataMap
- Map of authentication service attributes.orgName
- Organization DN.token
- Single sign on token.SMSException
- if failed to set the configuration because
of SM Exception.SSOException
- if single sign on token is not valid.AMConfigurationException
- if configName
is null or
not defined.public static void removeNamedConfig(String configName, String orgName, SSOToken token) throws SMSException, SSOException, AMConfigurationException
iPlanetAMAuthConfiguration
service. This method will be
used by console to manage configurations for different services.configName
- Name of the authentication configuration.orgName
- Organization DN.token
- Single Sign On token.SMSException
- if failed to delete the configuration because
of SM Exception.SSOException
- if single sign on token is not valid.AMConfigurationException
- if configName
is null
or not defined .public static Set getAllNamedConfig(String orgName, SSOToken token) throws SMSException, SSOException
iPlanetAMAuthConfiguration
service. This method will be
used by console to manage configurations for different services.orgName
- Organization DN.token
- Single Sign On token.SMSException
- if failed to get configurations because
of SM Exception.SSOException
- if single sign on token is not valid.public static Map<String,Set<String>> getNamedConfig(String configName, String orgName, SSOToken token) throws SMSException, SSOException, AMConfigurationException
iPlanetAMAuthConfiguration
service as XML string.
This method will be used by console to manage configurations for
different services.
Here is a sample XML string for an authentication configuration
<AttributeValuePair>This means user need to pass a required LDAP Login module, then an optional RADIUS Login module.
<Value>com.sun.identity.authentication.modules.LDAP required debug=true</Value>
<Value>com.sun.identity.authentication.modules.RADIUS optional</Value> </AttributeValuePair>
configName
- Name of the authentication configuration.orgName
- Organization DN.token
- Single Sign On token.SMSException
- if failed to get the configuration because
of SM Exception.SSOException
- if single sign on token is not valid.AMConfigurationException
- if configName
is null or
not defined.public static String getModuleName(String className)
className
- Class name, example
com.sun.identity.authentication.modules.ldap.LDAP
.public static String getModuleServiceName(String module)
module
- Login module name, e.g. "LDAP"iPlanetAMAuthLDAPService
public static String getAuthLevelAttribute(Map attrs, String module)
attrs
- parameter map of the module service.module
- Login module name, e.g. "LDAP".iplanet-am-auth-ldap-auth-level
or
sunIdentityServerLDAPAuthLevel
.public static ServiceSchema getServiceSchema(SSOToken token) throws AMConfigurationException
token
- Single Sign On token.AMConfigurationException
- if there are errors accessing
authentication configuration.public static Map getAllAuthModules(SSOToken token)
token
- Single Sign On token to be using for accessing configuration
information.com.sun.identity.authentication.modules.ldap.LDAP
)public static Map getAllAuthModules(String orgDN, SSOToken token)
orgDN
- organization DN.token
- single sign on token.com.sun.identity.authentication.modules.ldap.LDAP
)public static List xmlToAuthConfigurationEntry(String xmlValue)
AuthConfigurationEntry
which could be used to retrieve
module name, flag and options. Empty List will be returned if the XML
value could not be parsed.xmlValue
- XML value for the authentication configuration.AuthConfigurationEntry
contains module
name, flag and options.public static String authConfigurationEntryToXMLString(List entries)
AuthConfigurationEntry
to XML
representation according to following DTD.
<!-- AttributeValuePair defines the values used to specify authentication configuration information. --> <!ELEMENT AttributeValuePair (Value*) > <!-- Value defines one authentication configuration --> <!ELEMENT Value (#PCDATA) >
entries
- List of AuthConfigurationEntry
to be
processed.public static Set getGlobalAuthenticators(SSOToken token)
token
- Single sign on token to access configuration information.public static String getControlFlagAsString(AppConfigurationEntry.LoginModuleControlFlag controlFlag)
AppConfigurationEntry.LoginModuleControlFlag
.controlFlag
- The AppConfigurationEntry.LoginModuleControlFlag
AppConfigurationEntry.LoginModuleControlFlag
.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.