use of com.google.inject.Provides in project OpenAM by OpenRock.
the class CoreGuiceModule method getSAML2TokenRepository.
@Provides
@Singleton
SAML2TokenRepository getSAML2TokenRepository() {
final String DEFAULT_REPOSITORY_CLASS = "org.forgerock.openam.cts.impl.SAML2CTSPersistentStore";
final String REPOSITORY_CLASS_PROPERTY = "com.sun.identity.saml2.plugins.SAML2RepositoryImpl";
final String CTS_SAML2_REPOSITORY_CLASS_NAME = SystemPropertiesManager.get(REPOSITORY_CLASS_PROPERTY, DEFAULT_REPOSITORY_CLASS);
SAML2TokenRepository result;
try {
// Use Guice to create class to get all of its dependency goodness
result = InjectorHolder.getInstance(Class.forName(CTS_SAML2_REPOSITORY_CLASS_NAME).asSubclass(SAML2TokenRepository.class));
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}
return result;
}
use of com.google.inject.Provides in project OpenAM by OpenRock.
the class RestGuiceModule method getInternalCrestRealmRouter.
@Provides
@Named("InternalCrestRouter")
@Singleton
Router getInternalCrestRealmRouter(@Named("CrestRealmRouter") Router crestRealmRouter) {
Router internalCrestRouter = new Router();
internalCrestRouter.setDefaultRoute(crestRealmRouter);
return internalCrestRouter;
}
use of com.google.inject.Provides in project OpenAM by OpenRock.
the class ForgerockRestGuiceModule method getPrivilegeDefinitions.
@Provides
@Singleton
public Map<String, PrivilegeDefinition> getPrivilegeDefinitions() {
final Map<String, PrivilegeDefinition> definitions = new HashMap<>();
final PrivilegeDefinition evaluateDefinition = PrivilegeDefinition.getInstance("evaluate", PrivilegeDefinition.Action.READ);
definitions.put("evaluate", evaluateDefinition);
definitions.put("evaluateTree", evaluateDefinition);
definitions.put("copy", PrivilegeDefinition.getInstance("modify", PrivilegeDefinition.Action.MODIFY));
definitions.put("move", PrivilegeDefinition.getInstance("modify", PrivilegeDefinition.Action.MODIFY));
definitions.put("schema", PrivilegeDefinition.getInstance("schema", PrivilegeDefinition.Action.READ));
definitions.put("validate", PrivilegeDefinition.getInstance("validate", PrivilegeDefinition.Action.READ));
definitions.put("template", PrivilegeDefinition.getInstance("template", PrivilegeDefinition.Action.READ));
definitions.put("getPropertyNames", PrivilegeDefinition.getInstance("getPropertyNames", PrivilegeDefinition.Action.READ));
definitions.put("getProperty", PrivilegeDefinition.getInstance("getProperty", PrivilegeDefinition.Action.READ));
definitions.put("setProperty", PrivilegeDefinition.getInstance("setProperty", PrivilegeDefinition.Action.MODIFY));
definitions.put("deleteProperty", PrivilegeDefinition.getInstance("deleteProperty", PrivilegeDefinition.Action.MODIFY));
return definitions;
}
use of com.google.inject.Provides in project OpenAM by OpenRock.
the class SoapSTSInstanceModule method getProperties.
/*
*/
/**
* These properties configure the web-service deployment, and are primarily referenced by the ws-security interceptors
* deployed as part of CXF. These interceptors are responsible for enforcing the security-policy bindings protecting
* the STS. To this end, various crypto objects are required, and the TokenValidators for the configured validated
* token types are plugged-in.
* @param wssValidatorFactory the factory class which will produce the wss Validator instances to enforce SecurityPolicy bindings
* @param logger for error state logging
* @return the Map that serves to configure the web-service deployment
* @throws WSSecurityException In case an unexpected TokenType is encountered, or a TokenValidator could not be created.
*/
@Provides
@Named(AMSTSConstants.STS_WEB_SERVICE_PROPERTIES)
@Inject
Map<String, Object> getProperties(WSSValidatorFactory wssValidatorFactory, Logger logger) throws WSSecurityException {
Map<String, Object> properties = new HashMap<>();
// KeystoreConfig may be null for a TLS-based SecurityPolicy binding, or for the AM-bare binding.
if (stsInstanceConfig.getKeystoreConfig() != null) {
properties.put(SecurityConstants.CALLBACK_HANDLER, new SoapSTSCallbackHandler(stsInstanceConfig.getKeystoreConfig(), logger));
Crypto crypto = CryptoFactory.getInstance(getEncryptionProperties());
properties.put(SecurityConstants.ENCRYPT_CRYPTO, crypto);
properties.put(SecurityConstants.SIGNATURE_CRYPTO, crypto);
properties.put(SecurityConstants.SIGNATURE_USERNAME, stsInstanceConfig.getKeystoreConfig().getSignatureKeyAlias());
}
properties.put("faultStackTraceEnabled", "true");
properties.put("exceptionMessageCauseEnabled", "true");
processSecurityPolicyTokenValidatorConfiguration(properties, wssValidatorFactory, logger);
return properties;
}
use of com.google.inject.Provides in project OpenAM by OpenRock.
the class RadiusServerGuiceModule method getRadiusServiceConfigManger.
/**
* Guice provider for the ServiceConfigManager.
*
* @return a ServiceConfigurationManager that can be used
* @throws RadiusLifecycleException - when the service config manager can not be obtained.
*/
@Provides
@Named("RadiusServer")
protected ServiceConfigManager getRadiusServiceConfigManger() throws RadiusLifecycleException {
ServiceConfigManager mgr = null;
// get a ServiceConfigManager for our service
try {
final SSOToken admTk = AccessController.doPrivileged(AdminTokenAction.getInstance());
mgr = new ServiceConfigManager(RadiusServerConstants.RADIUS_SERVICE_NAME, admTk);
} catch (final Exception e) {
throw new RadiusLifecycleException("Could not obtain ServiceConfigManger for the RADIUS service.", e);
}
return mgr;
}
Aggregations