There was an exception from the listener, resulting in " This page can’t be displayed" error in the browser after successful login. Sometimes this exception bubbles up to the client and kills the app
```
static void live_client()
{
oauth2_config live_cfg(s_live_key, s_live_secret,
U("https://login.live.com/oauth20_authorize.srf"),
U("https://login.live.com/oauth20_token.srf"),
U("http://www.livetestdummy.arturl.com:8890/"));
// Scope "wl.basic" allows getting user information.
live_cfg.set_scope(U("wl.basic wl.contacts_photos"));
http_client_config config;
config.set_oauth2(live_cfg);
http_client api(U("https://apis.live.net/v5.0/"), config);
live_cfg.fetch_token(code_from_localhost_listener(live_cfg)).then([&] {
return api.request(methods::GET, U("me/albums?"));
}).then([&](http_response albums) {
return albums.extract_json();
}).then([&](json::value albums) {
auto& obj = albums.as_object();
auto& data = obj[U("data")].as_array();
ucout << "Albums:" << std::endl;
for (auto&x : data)
{
ucout << x.as_object()[U("name")] << std::endl;
}
}).wait();
}
```
```
static void live_client()
{
oauth2_config live_cfg(s_live_key, s_live_secret,
U("https://login.live.com/oauth20_authorize.srf"),
U("https://login.live.com/oauth20_token.srf"),
U("http://www.livetestdummy.arturl.com:8890/"));
// Scope "wl.basic" allows getting user information.
live_cfg.set_scope(U("wl.basic wl.contacts_photos"));
http_client_config config;
config.set_oauth2(live_cfg);
http_client api(U("https://apis.live.net/v5.0/"), config);
live_cfg.fetch_token(code_from_localhost_listener(live_cfg)).then([&] {
return api.request(methods::GET, U("me/albums?"));
}).then([&](http_response albums) {
return albums.extract_json();
}).then([&](json::value albums) {
auto& obj = albums.as_object();
auto& data = obj[U("data")].as_array();
ucout << "Albums:" << std::endl;
for (auto&x : data)
{
ucout << x.as_object()[U("name")] << std::endl;
}
}).wait();
}
```