-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth10Credentials json issue #51
Comments
stable branch and oF 0.10.1 |
Hm. Odd, will take a look. Are you on macOS? If so, which version of Xcode, macOS, etc? |
mac 10.14.4 Yeah, I haven't properly migrate my head from oxfJSON to nlohmann to advise yet, but it's something about the json deserialization values I think. Ended up commenting out this passage as not using SSL for this project. As alway, I really appreciate your quality addons man. |
Running into the same issue after upgrading to 10.14.6 from 10.14.3. |
Hi @loganwilliams are you using the develop branch of ofxHTTP and its dependencies? |
Also, have you tried upgrading your version of nlohmann::json like this bakercp/ofxSerializer#1 |
@bakercp I am using the |
@loganwilliams good to know. The next release of OF should include a newer version of |
The issue is also present on Windows with Visual Studio 2019 ( |
It turns out it's easily fixable, here's the working code : OAuth10Credentials OAuth10Credentials::fromJSON(const ofJson& json)
{
OAuth10Credentials credentials;
auto iter = json.cbegin();
while (iter != json.cend())
{
const auto& key = iter.key();
const auto& value = iter.value();
// just add .get<std::string>() for each assignment
if (key == "consumerKey") credentials._consumerKey = value.get<std::string>();
else if (key == "consumerSecret" || key == "consumer_secret")
credentials._consumerSecret = value.get<std::string>();
else if (key == "accessToken" || key == "access_token")
credentials._accessToken = value.get<std::string>();
else if (key == "accessTokenSecret" || key == "access_token_secret")
credentials._accessTokenSecret = value.get<std::string>();
else if (key == "owner")
credentials._owner = value.get<std::string>();
else if (key == "ownerId" || key == "owner_id")
credentials._ownerId = value.get<std::string>();
else ofLogWarning("Credentials::fromJSON") << "Unknown key: " << key << std::endl << value.dump(4);
++iter;
}
return credentials;
} It's working with |
This commit fixes compilation issues on MacOS and Windows described in issue bakercp#51.
The text was updated successfully, but these errors were encountered: