LinkedInService::LinkedInService(const AuthService& baseAuth, bool getUserProfileAsJson) : OAuthService(baseAuth) { this->getUserProfileAsJson = getUserProfileAsJson; popupDialogWidth = 500; popupDialogHeight = 600; try { std::string propertyValue = configurationProperty(LinkedInPopupWidthProperty); popupDialogWidth = atoi(propertyValue.c_str()); } catch (Wt::WException* e) { LOG_ERROR("LinkedInService(): could not read configuration property " << LinkedInPopupWidthProperty << ": " << e->what() << ", using default value " << popupDialogWidth); } try { std::string propertyValue = configurationProperty(LinkedInPopupHeightProperty); popupDialogHeight = atoi(propertyValue.c_str()); } catch (Wt::WException* e) { LOG_ERROR("LinkedInService(): could not read configuration property " << LinkedInPopupHeightProperty << ": " << e->what() << ", using default value " << popupDialogHeight); } }
bool LinkedInService::configured() { try { configurationProperty(RedirectEndpointProperty); configurationProperty(ClientIdProperty); configurationProperty(ClientSecretProperty); return true; } catch (const std::exception& e) { LOG_INFO("not configured: " << e.what()); return false; } }
std::string FacebookService::redirectEndpointPath() const { try { return configurationProperty(RedirectEndpointPathProperty); } catch (const std::exception& e) { return OAuthService::redirectEndpointPath(); } }
GoogleService::GoogleService(const AuthService& baseAuth) : OidcService(baseAuth) { setRedirectEndpoint(configurationProperty(RedirectEndpointProperty)); setClientId(configurationProperty(ClientIdProperty)); setClientSecret(configurationProperty(ClientSecretProperty)); setAuthEndpoint("https://accounts.google.com/o/oauth2/v2/auth"); setTokenEndpoint("https://www.googleapis.com/oauth2/v4/token"); setUserInfoEndpoint("https://www.googleapis.com/oauth2/v3/userinfo"); setAuthenticationScope("openid email profile"); setName("google"); setDescription("Google Account"); setPopupWidth(550); }
std::string FacebookService::clientSecret() const { return configurationProperty(ClientSecretProperty); }
std::string FacebookService::redirectEndpoint() const { return configurationProperty(RedirectEndpointProperty); }
std::string LinkedInService::clientSecret() const { return configurationProperty(ClientSecretProperty); }
std::string LinkedInService::redirectEndpoint() const { return configurationProperty(RedirectEndpointProperty); }