Class WSFederationMetaManager
- java.lang.Object
-
- com.sun.identity.wsfederation.meta.WSFederationMetaManager
-
public class WSFederationMetaManager extends Object
TheWSFederationMetaManagerprovides methods to manage both the standard entity descriptor and the extended entity configuration.
-
-
Constructor Summary
Constructors Constructor Description WSFederationMetaManager()WSFederationMetaManager(Object callerToken)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateEntityConfig(String realm, FederationConfigElement config)Creates the extended entity configuration under the realm.voidcreateFederation(String realm, FederationElement federation)Creates the standard metadata entity descriptor under the realm.voiddeleteEntityConfig(String realm, String federationId)Deletes the extended entity configuration under the realm.voiddeleteFederation(String realm, String federationId)Deletes the standard metadata entity descriptor under the realm.Set<String>getAllEntities(String realm)Returns all entities under the realm.List<String>getAllHostedEntities(String realm)Returns all hosted entities under the realm.List<String>getAllHostedIdentityProviderEntities(String realm)Returns all hosted identity provider entities under the realm.List<String>getAllHostedIdentityProviderMetaAliases(String realm)Returns metaAliases of all hosted identity providers under the realm.List<String>getAllHostedMetaAliasesByRealm(String realm)Returns all the hosted entity metaAliases for a realm.ListgetAllHostedServiceProviderEntities(String realm)Returns all hosted service provider entities under the realm.List<String>getAllHostedServiceProviderMetaAliases(String realm)Returns metaAliases of all hosted service providers under the realm.List<String>getAllRemoteEntities(String realm)Returns all remote entities under the realm.List<String>getAllRemoteIdentityProviderEntities(String realm)Returns all remote identity provider entities under the realm.List<String>getAllRemoteServiceProviderEntities(String realm)Returns all remote service provider entities under the realm.BaseConfigTypegetBaseConfig(String realm, String federationId)Returns first identity provider's SSO configuration in an entity under the realm.StringgetEntityByMetaAlias(String metaAlias)Returns entity ID associated with the metaAlias.StringgetEntityByTokenIssuerName(String realm, String issuer)Returns entity ID associated with the token issuer name.FederationConfigElementgetEntityConfig(String realm, String federationId)Returns extended entity configuration under the realm.FederationElementgetEntityDescriptor(String realm, String entityId)Returns the standard metadata federation element under the realm.IDPSSOConfigElementgetIDPSSOConfig(String realm, String federationId)Returns first identity provider's SSO configuration in an entity under the realm.StringgetRoleByMetaAlias(String metaAlias)Returns role of an entity based on its metaAlias.SPSSOConfigElementgetSPSSOConfig(String realm, String federationId)Returns first service provider's SSO configuration in an entity under the realm.StringgetTokenIssuerEndpoint(FederationElement fed)Returns the value of the<TokenIssuerEndpoint>element for the given entity.StringgetTokenIssuerName(FederationElement fed)Returns the value of the<TokenIssuerName>element for the given entity.byte[]getTokenSigningCertificate(FederationElement fed)Returns the value of the<TokenSigningCertificate>element for the given entity.UriNamedClaimTypesOfferedElementgetUriNamedClaimTypesOffered(FederationElement fed)Returns the value of the<UriNamedClaimTypesOffered>element for the given entity.booleanisTrustedProvider(String realm, String federationId, String trustedEntityId)Determines whether two entities are in the same circle of trust under the realm.voidsetEntityConfig(String realm, FederationConfigElement config)Sets the extended entity configuration under the realm.voidsetFederation(String realm, FederationElement federation)Sets the standard metadata entity descriptor under the realm.voidvalidateMetaAliasForNewEntity(String realm, List<String> newMetaAliases)Checks that the provided metaAliases are valid for a new hosted entity in the specified realm.
-
-
-
Constructor Detail
-
WSFederationMetaManager
public WSFederationMetaManager() throws WSFederationMetaException- Throws:
WSFederationMetaException
-
WSFederationMetaManager
public WSFederationMetaManager(Object callerToken) throws WSFederationMetaException
- Throws:
WSFederationMetaException
-
-
Method Detail
-
getEntityDescriptor
public FederationElement getEntityDescriptor(String realm, String entityId) throws WSFederationMetaException
Returns the standard metadata federation element under the realm.- Parameters:
realm- The realm under which the federation resides.entityId- ID of the federation to be retrieved.- Returns:
FederationElementfor the entity or null if not found.- Throws:
WSFederationMetaException- if unable to retrieve the entity descriptor.
-
setFederation
public void setFederation(String realm, FederationElement federation) throws WSFederationMetaException
Sets the standard metadata entity descriptor under the realm.- Parameters:
realm- The realm under which the entity resides.federation- Federation object.- Throws:
WSFederationMetaException- if unable to set the entity descriptor.
-
createFederation
public void createFederation(String realm, FederationElement federation) throws WSFederationMetaException
Creates the standard metadata entity descriptor under the realm.- Parameters:
realm- The realm under which the entity descriptor will be created.federation- The standard entity descriptor object to be created.- Throws:
WSFederationMetaException- if unable to create the entity descriptor.
-
deleteFederation
public void deleteFederation(String realm, String federationId) throws WSFederationMetaException
Deletes the standard metadata entity descriptor under the realm.- Parameters:
realm- The realm under which the entity resides.federationId- The ID of the entity for whom the standard entity descriptor will be deleted.- Throws:
WSFederationMetaException- if unable to delete the entity descriptor.
-
getEntityConfig
public FederationConfigElement getEntityConfig(String realm, String federationId) throws WSFederationMetaException
Returns extended entity configuration under the realm.- Parameters:
realm- The realm under which the entity resides.federationId- ID of the entity to be retrieved.- Returns:
FederationConfigElementobject for the entity or null if not found.- Throws:
WSFederationMetaException- if unable to retrieve the entity configuration.
-
getSPSSOConfig
public SPSSOConfigElement getSPSSOConfig(String realm, String federationId) throws WSFederationMetaException
Returns first service provider's SSO configuration in an entity under the realm.- Parameters:
realm- The realm under which the entity resides.federationId- ID of the entity to be retrieved.- Returns:
SPSSOConfigElementfor the entity or null if not found.- Throws:
WSFederationMetaException- if unable to retrieve the first service provider's SSO configuration.
-
getIDPSSOConfig
public IDPSSOConfigElement getIDPSSOConfig(String realm, String federationId) throws WSFederationMetaException
Returns first identity provider's SSO configuration in an entity under the realm.- Parameters:
realm- The realm under which the entity resides.federationId- ID of the entity to be retrieved.- Returns:
IDPSSOConfigElementfor the entity or null if not found.- Throws:
WSFederationMetaException- if unable to retrieve the first identity provider's SSO configuration.
-
getBaseConfig
public BaseConfigType getBaseConfig(String realm, String federationId) throws WSFederationMetaException
Returns first identity provider's SSO configuration in an entity under the realm.- Parameters:
realm- The realm under which the entity resides.federationId- ID of the entity to be retrieved.- Returns:
BaseConfigElementfor the entity or null if not found.- Throws:
WSFederationMetaException- if unable to retrieve the first identity provider's SSO configuration.
-
setEntityConfig
public void setEntityConfig(String realm, FederationConfigElement config) throws WSFederationMetaException
Sets the extended entity configuration under the realm.- Parameters:
realm- The realm under which the entity resides.config- The extended entity configuration object to be set.- Throws:
WSFederationMetaException- if unable to set the entity configuration.
-
createEntityConfig
public void createEntityConfig(String realm, FederationConfigElement config) throws WSFederationMetaException
Creates the extended entity configuration under the realm.- Parameters:
realm- The realm under which the entity configuration will be created.config- The extended entity configuration object to be created.- Throws:
WSFederationMetaException- if unable to create the entity configuration.
-
deleteEntityConfig
public void deleteEntityConfig(String realm, String federationId) throws WSFederationMetaException
Deletes the extended entity configuration under the realm.- Parameters:
realm- The realm under which the entity resides.federationId- The ID of the entity for whom the extended entity configuration will be deleted.- Throws:
WSFederationMetaException- if unable to delete the entity descriptor.
-
validateMetaAliasForNewEntity
public void validateMetaAliasForNewEntity(String realm, List<String> newMetaAliases) throws WSFederationMetaException
Checks that the provided metaAliases are valid for a new hosted entity in the specified realm. Will verify that the metaAliases do not already exist in the realm and that no duplicates are provided.- Parameters:
realm- The realm in which we are validating the metaAliases.newMetaAliases- values we are using to create the new metaAliases.- Throws:
WSFederationMetaException- if duplicate values found.
-
getAllHostedMetaAliasesByRealm
public List<String> getAllHostedMetaAliasesByRealm(String realm) throws WSFederationMetaException
Returns all the hosted entity metaAliases for a realm.- Parameters:
realm- The given realm.- Returns:
- all the hosted entity metaAliases for a realm or an empty arrayList if not found.
- Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getAllHostedEntities
public List<String> getAllHostedEntities(String realm) throws WSFederationMetaException
Returns all hosted entities under the realm.- Parameters:
realm- The realm under which the hosted entities reside.- Returns:
- a
Listof entity IDString. - Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getAllHostedServiceProviderEntities
public List getAllHostedServiceProviderEntities(String realm) throws WSFederationMetaException
Returns all hosted service provider entities under the realm.- Parameters:
realm- The realm under which the hosted service provider entities reside.- Returns:
- a
Listof entity IDString. - Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getAllHostedIdentityProviderEntities
public List<String> getAllHostedIdentityProviderEntities(String realm) throws WSFederationMetaException
Returns all hosted identity provider entities under the realm.- Parameters:
realm- The realm under which the hosted identity provider entities reside.- Returns:
- a
Listof entity IDString. - Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getAllRemoteEntities
public List<String> getAllRemoteEntities(String realm) throws WSFederationMetaException
Returns all remote entities under the realm.- Parameters:
realm- The realm under which the hosted entities reside.- Returns:
- a
Listof entity IDString. - Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getAllRemoteServiceProviderEntities
public List<String> getAllRemoteServiceProviderEntities(String realm) throws WSFederationMetaException
Returns all remote service provider entities under the realm.- Parameters:
realm- The realm under which the remote service provider entities reside.- Returns:
- a
Listof entity IDString. - Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getAllRemoteIdentityProviderEntities
public List<String> getAllRemoteIdentityProviderEntities(String realm) throws WSFederationMetaException
Returns all remote identity provider entities under the realm.- Parameters:
realm- The realm under which the remote identity provider entities reside.- Returns:
- a
Listof entity IDString. - Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getEntityByMetaAlias
public String getEntityByMetaAlias(String metaAlias) throws WSFederationMetaException
Returns entity ID associated with the metaAlias.- Parameters:
metaAlias- The metaAlias.- Returns:
- entity ID associated with the metaAlias or null if not found.
- Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getEntityByTokenIssuerName
public String getEntityByTokenIssuerName(String realm, String issuer) throws WSFederationMetaException
Returns entity ID associated with the token issuer name.- Parameters:
issuer- Token issuer name.- Returns:
- entity ID associated with the metaAlias or null if not found.
- Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getRoleByMetaAlias
public String getRoleByMetaAlias(String metaAlias) throws WSFederationMetaException
Returns role of an entity based on its metaAlias.- Parameters:
metaAlias- Meta alias of the entity.- Returns:
- role of an entity either
SAML2Constants.IDP_ROLE; orSAML2Constants.SP_ROLEorSAML2Constants.UNKNOWN_ROLE - Throws:
WSFederationMetaException- if there are issues in getting the entity profile from the meta alias.
-
getAllHostedIdentityProviderMetaAliases
public List<String> getAllHostedIdentityProviderMetaAliases(String realm) throws WSFederationMetaException
Returns metaAliases of all hosted identity providers under the realm.- Parameters:
realm- The realm under which the identity provider metaAliases reside.- Returns:
- a
Listof metaAliasesString. - Throws:
WSFederationMetaException- if unable to retrieve meta aliases.
-
getAllHostedServiceProviderMetaAliases
public List<String> getAllHostedServiceProviderMetaAliases(String realm) throws WSFederationMetaException
Returns metaAliases of all hosted service providers under the realm.- Parameters:
realm- The realm under which the service provider metaAliases reside.- Returns:
- a
Listof metaAliasesString. - Throws:
WSFederationMetaException- if unable to retrieve meta aliases.
-
isTrustedProvider
public boolean isTrustedProvider(String realm, String federationId, String trustedEntityId) throws WSFederationMetaException
Determines whether two entities are in the same circle of trust under the realm.- Parameters:
realm- The realm under which the entity resides.federationId- The ID of the entitytrustedEntityId- The ID of the entity- Throws:
WSFederationMetaException- if unable to determine the trusted relationship.
-
getAllEntities
public Set<String> getAllEntities(String realm) throws WSFederationMetaException
Returns all entities under the realm.- Parameters:
realm- The realm under which the entities reside.- Returns:
- a
Setof entity IDString. - Throws:
WSFederationMetaException- if unable to retrieve the entity ids.
-
getTokenIssuerEndpoint
public String getTokenIssuerEndpoint(FederationElement fed)
Returns the value of the<TokenIssuerEndpoint>element for the given entity.- Parameters:
fed- The standard metadata for the entity.- Returns:
- the value of the
<TokenIssuerEndpoint>element
-
getTokenIssuerName
public String getTokenIssuerName(FederationElement fed)
Returns the value of the<TokenIssuerName>element for the given entity.- Parameters:
fed- The standard metadata for the entity.- Returns:
- the value of the
<TokenIssuerName>element
-
getTokenSigningCertificate
public byte[] getTokenSigningCertificate(FederationElement fed)
Returns the value of the<TokenSigningCertificate>element for the given entity.- Parameters:
fed- The standard metadata for the entity.- Returns:
- byte array containing the decoded value of the
<TokenSigningCertificate>element
-
getUriNamedClaimTypesOffered
public UriNamedClaimTypesOfferedElement getUriNamedClaimTypesOffered(FederationElement fed)
Returns the value of the<UriNamedClaimTypesOffered>element for the given entity.- Parameters:
fed- The standard metadata for the entity.- Returns:
UriNamedClaimTypesOfferedElementcontaining the offered claim types.<UriNamedClaimTypesOffered>element
-
-