All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kinde.client.KindeClientGuiceModule Maven / Gradle / Ivy

The newest version!
package com.kinde.client;

import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.kinde.config.KindeConfig;
import com.kinde.config.KindeConfigImpl;
import com.kinde.config.KindeParameters;
import com.kinde.KindeClient;
import com.kinde.client.oidc.OidcMetaDataImpl;
import com.kinde.guice.KindeAnnotations;
import com.kinde.guice.KindeEnvironmentSingleton;
import lombok.AllArgsConstructor;

import java.util.Map;

@AllArgsConstructor
public class KindeClientGuiceModule extends AbstractModule {

    private Map parameters;


    @Provides
    @KindeAnnotations.ClientConfigParameters
    public Map provideParameters() {
        return this.parameters;
    }

    @Override
    protected void configure() {
        if (KindeEnvironmentSingleton.getInstance().getState() == KindeEnvironmentSingleton.State.ACTIVE) {
            bind(OidcMetaData.class).to(OidcMetaDataImpl.class);
        }
        bind(KindeConfig.class).to(KindeConfigImpl.class);
        bind(KindeClient.class).to(KindeClientImpl.class);

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy