
com.wadpam.oauth2.itest.IntegrationTestConnectionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oauth2-client Show documentation
Show all versions of oauth2-client Show documentation
Implements OAuth2 authentication on top of Open-Server security
The newest version!
/*
* INSERT COPYRIGHT HERE
*/
package com.wadpam.oauth2.itest;
import com.google.appengine.api.NamespaceManager;
import com.wadpam.oauth2.domain.DFactory;
import com.wadpam.oauth2.service.OAuth2Service;
import com.wadpam.open.mvc.CrudService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.social.connect.support.OAuth2ConnectionFactory;
/**
*
* @author sosandstrom
*/
public class IntegrationTestConnectionFactory extends OAuth2ConnectionFactory {
private CrudService factoryService;
public IntegrationTestConnectionFactory() {
super(OAuth2Service.PROVIDER_ID_ITEST, new ITestServiceProvider(), new ITestApiAdapter());
}
public void init() {
final String current = NamespaceManager.get();
try {
NamespaceManager.set("itest");
DFactory itestFactory = new DFactory();
itestFactory.setId(OAuth2Service.PROVIDER_ID_ITEST);
factoryService.create(itestFactory);
}
finally {
NamespaceManager.set(current);
}
}
@Autowired
public void setFactoryService(CrudService factoryService) {
this.factoryService = factoryService;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy