Changeset - 6fc502c3c9c4
[Not reviewed]
0 2 0
Jan Kaluza - 10 years ago 2016-01-24 12:04:14
jkaluza@redhat.com
Slack: redirect to https instead of http
2 files changed with 13 insertions and 1 deletions:
0 comments (0 inline, 0 general)
libtransport/OAuth2.cpp
Show inline comments
 
@@ -84,15 +84,27 @@ std::string OAuth2::requestToken(const std::string &code, std::string &token) {
 
	rapidjson::Document resp;
 
	HTTPRequest req(HTTPRequest::Get, url);
 
	if (!req.execute(resp)) {
 
		LOG4CXX_ERROR(logger, url);
 
		LOG4CXX_ERROR(logger, req.getError());
 
		return req.getError();
 
	}
 

	
 
	rapidjson::Value& access_token = resp["access_token"];
 
	if (!access_token.IsString()) {
 
		LOG4CXX_ERROR(logger, "No 'access_token' object in the reply.");
 
		LOG4CXX_ERROR(logger, url);
 
		LOG4CXX_ERROR(logger, req.getRawData());
 
		return "No 'access_token' object in the reply.";
 
	}
 

	
 
	token = access_token.GetString();
 
	if (token.empty()) {
 
		LOG4CXX_ERROR(logger, "Empty 'access_token' object in the reply.");
 
		LOG4CXX_ERROR(logger, url);
 
		LOG4CXX_ERROR(logger, req.getRawData());
 
		return "Empty 'access_token' object in the reply.";
 
	}
 

	
 
	return "";
 
}
 

	
spectrum/src/frontends/slack/SlackUserRegistration.cpp
Show inline comments
 
@@ -62,7 +62,7 @@ SlackUserRegistration::~SlackUserRegistration(){
 
}
 

	
 
std::string SlackUserRegistration::createOAuth2URL(const std::vector<std::string> &args) {
 
	std::string redirect_url = "http://slack.spectrum.im/oauth2/" + CONFIG_STRING(m_config, "service.jid");
 
	std::string redirect_url = "https://slack.spectrum.im/oauth2/" + CONFIG_STRING(m_config, "service.jid");
 
	OAuth2 *oauth2 = new OAuth2(CONFIG_STRING_DEFAULTED(m_config, "service.client_id",""),
 
						  CONFIG_STRING_DEFAULTED(m_config, "service.client_secret",""),
 
						  "https://slack.com/oauth/authorize",
0 comments (0 inline, 0 general)