Search in sources :

Example 1 with SimbaServiceFactory

use of org.simbasecurity.dwclient.gateway.SimbaServiceFactory in project simba-os by cegeka.

the class SimbaManagerRule method before.

private void before() throws IOException, ConfigurationException, SimbaUnavailableException {
    SimbaManagerRestConfiguration simbaRestMgrConfig = getSimbaManagerRestConfiguration();
    simbaWebResource = getSimbaWebResource(simbaRestMgrConfig);
    String simbaWebURL = simbaRestMgrConfig.getSimbaWebURL();
    SimbaGateway simbaGateway = new SimbaGateway(simbaWebURL, new SimbaServiceFactory(), new SimbaCredentialsFactory(simbaWebURL));
    String appUser = simbaRestMgrConfig.getAppUser();
    String appPassword = simbaRestMgrConfig.getAppPassword();
    ssoToken = simbaGateway.login(appUser, appPassword);
    if (!ssoToken.isPresent()) {
        fail(String.format("Unsuccessful login for configured user/password: %s/%s", appUser, appPassword));
    }
}
Also used : SimbaManagerRestConfiguration(org.simbasecurity.dwclient.dropwizard.config.SimbaManagerRestConfiguration) SimbaServiceFactory(org.simbasecurity.dwclient.gateway.SimbaServiceFactory) SimbaCredentialsFactory(org.simbasecurity.dwclient.dropwizard.credentials.SimbaCredentialsFactory) SimbaGateway(org.simbasecurity.dwclient.gateway.SimbaGateway)

Aggregations

SimbaManagerRestConfiguration (org.simbasecurity.dwclient.dropwizard.config.SimbaManagerRestConfiguration)1 SimbaCredentialsFactory (org.simbasecurity.dwclient.dropwizard.credentials.SimbaCredentialsFactory)1 SimbaGateway (org.simbasecurity.dwclient.gateway.SimbaGateway)1 SimbaServiceFactory (org.simbasecurity.dwclient.gateway.SimbaServiceFactory)1