Search in sources :

Example 1 with SnapshotTokenHandlerFactory

use of org.forgerock.selfservice.core.snapshot.SnapshotTokenHandlerFactory in project OpenAM by OpenRock.

the class SelfServiceGuiceModule method configure.

@Override
protected void configure() {
    install(new FactoryModuleBuilder().implement(SnapshotTokenHandlerFactory.class, JwtSnapshotTokenHandlerFactory.class).build(new TypeLiteral<KeyPairInjector<SnapshotTokenHandlerFactory>>() {
    }));
    bind(ProcessStore.class).to(ProcessStoreImpl.class);
    bind(ServiceConfigProviderFactory.class).to(ServiceConfigProviderFactoryImpl.class);
    bind(SelfServiceFactory.class).to(SelfServiceFactoryImpl.class);
    bind(KbaResource.class);
    try {
        bind(Client.class).annotatedWith(SelfService.class).toInstance(new Client(new HttpClientHandler()));
    } catch (HttpApplicationException haE) {
        throw new HttpClientCreationException("Unable to create http client", haE);
    }
    // Registration CREST services
    expose(new TypeLiteral<SelfServiceRequestHandler<UserRegistrationConsoleConfig>>() {
    });
    expose(new TypeLiteral<SelfServiceRequestHandler<ForgottenPasswordConsoleConfig>>() {
    });
    expose(new TypeLiteral<SelfServiceRequestHandler<ForgottenUsernameConsoleConfig>>() {
    });
    expose(UserUpdateService.class);
    expose(KbaResource.class);
    // Exposed to be accessible to custom progress stages
    expose(ConnectionFactory.class).annotatedWith(SelfService.class);
    expose(Client.class).annotatedWith(SelfService.class);
}
Also used : ProcessStore(org.forgerock.selfservice.core.ProcessStore) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) SnapshotTokenHandlerFactory(org.forgerock.selfservice.core.snapshot.SnapshotTokenHandlerFactory) Resources.newInternalConnectionFactory(org.forgerock.json.resource.Resources.newInternalConnectionFactory) ConnectionFactory(org.forgerock.json.resource.ConnectionFactory) TypeLiteral(com.google.inject.TypeLiteral) ServiceConfigProviderFactory(org.forgerock.openam.selfservice.config.ServiceConfigProviderFactory) SelfService(org.forgerock.selfservice.core.annotations.SelfService) Client(org.forgerock.http.Client) HttpClientHandler(org.forgerock.http.handler.HttpClientHandler) HttpApplicationException(org.forgerock.http.HttpApplicationException)

Example 2 with SnapshotTokenHandlerFactory

use of org.forgerock.selfservice.core.snapshot.SnapshotTokenHandlerFactory in project OpenAM by OpenRock.

the class SelfServiceFactoryImpl method getService.

@Override
public RequestHandler getService(String realm, ProcessInstanceConfig serviceConfig) {
    KeyPairProvider keyPairProvider = keyPairProviderFactory.getProvider(realm);
    SnapshotTokenHandlerFactory tokenHandlerFactory = keyPairInjector.getInjectedWith(keyPairProvider);
    ClassLoader classLoader = getClass().getClassLoader();
    return new AnonymousProcessService(serviceConfig, stageProvider, tokenHandlerFactory, processStore, classLoader);
}
Also used : KeyPairProvider(org.forgerock.openam.shared.security.crypto.KeyPairProvider) SnapshotTokenHandlerFactory(org.forgerock.selfservice.core.snapshot.SnapshotTokenHandlerFactory) AnonymousProcessService(org.forgerock.selfservice.core.AnonymousProcessService)

Aggregations

SnapshotTokenHandlerFactory (org.forgerock.selfservice.core.snapshot.SnapshotTokenHandlerFactory)2 TypeLiteral (com.google.inject.TypeLiteral)1 FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 Client (org.forgerock.http.Client)1 HttpApplicationException (org.forgerock.http.HttpApplicationException)1 HttpClientHandler (org.forgerock.http.handler.HttpClientHandler)1 ConnectionFactory (org.forgerock.json.resource.ConnectionFactory)1 Resources.newInternalConnectionFactory (org.forgerock.json.resource.Resources.newInternalConnectionFactory)1 ServiceConfigProviderFactory (org.forgerock.openam.selfservice.config.ServiceConfigProviderFactory)1 KeyPairProvider (org.forgerock.openam.shared.security.crypto.KeyPairProvider)1 AnonymousProcessService (org.forgerock.selfservice.core.AnonymousProcessService)1 ProcessStore (org.forgerock.selfservice.core.ProcessStore)1 SelfService (org.forgerock.selfservice.core.annotations.SelfService)1