Search in sources :

Example 1 with IOAuthFlowConfiguration

use of org.eclipse.vorto.repository.oauth.IOAuthFlowConfiguration in project vorto by eclipse.

the class OAuthProvider method from.

public static OAuthProvider from(IOAuthProvider source) {
    OAuthProvider result = new OAuthProvider();
    result.setId(source.getId());
    result.setLabel(source.getLabel());
    if (source.getWebflowConfiguration().isPresent()) {
        IOAuthFlowConfiguration config = source.getWebflowConfiguration().get();
        result.setLogoHref(config.getLogoHref());
        result.setLoginUrl(config.getFilterProcessingUrl());
    /*
      Assigning the Bosch ID icon to the non-webflow providers, because there will only be the two
      Suite OAuth versions in there for now (actually "merged" into one for presentational
      purposes).
       */
    } else {
        if (source.getLabel().equals(BOSCH_SUITE_OAUTH_LABEL)) {
            result.setLogoHref("webjars/repository-web/dist/images/bosch-social.png");
        }
    }
    return result;
}
Also used : IOAuthFlowConfiguration(org.eclipse.vorto.repository.oauth.IOAuthFlowConfiguration) IOAuthProvider(org.eclipse.vorto.repository.oauth.IOAuthProvider)

Aggregations

IOAuthFlowConfiguration (org.eclipse.vorto.repository.oauth.IOAuthFlowConfiguration)1 IOAuthProvider (org.eclipse.vorto.repository.oauth.IOAuthProvider)1