@Override
public void init() {
try {
// load configuration
InputStream is = getServletContext().getResourceAsStream(CONFIG_FILENAME);
Config config = new Config(is);
CLIENT_ID = config.get("google", "client_id");
if (CLIENT_ID == null) {
throw new Exception("Parameter 'google.client_id' missing in config");
}
CLIENT_SECRET = config.get("google", "client_secret");
if (CLIENT_SECRET == null) {
throw new Exception("Parameter 'google.client_secret' missing in config");
}
REDIRECT_URI = config.get("google_auth_servlet_url");
// TODO: cleanup deprecated parameter some day (deprecated since 2013-02-15)
if (REDIRECT_URI == null) {
REDIRECT_URI = config.get("auth_google_servlet_url");
if (REDIRECT_URI != null) {
logger.warning("Parameter 'auth_google_servlet_url' is deprecated. " +
"Use 'google_auth_servlet_url' instead.");
}
}