Loginbar Endpoint

Loginbar is a service that allows to load some personal data of currently logged in user in JavaScript code without OAuth access token. Loginbar support CORS requests.

Request

Example loginbar request
const response = await fetch('https://konto.onet.pl/checkSSO/loginbar.json?client_id=blic.rs.front&body%5Bparams%5D%5Bfields%5D=signature%2CuserId%2Clogin%2CloginHash', {
  credentials: 'include'
});
const myJson = await response.json();
console.log(JSON.stringify(myJson));

Parameters:

  • client_id - [optional] - Onet Konto system APPLICATION_NAME with optional removed “onetapi.pl” suffix

  • body[params][fields] - [optional, default: “login”] - comma-separated field names of user profile to return (login - user email/identity, external - external mail account, channel - notifications channel, counter - initial number of notifications, lastVisitCounter - initial number of notifications since last visit, lastVisit - notification last visit date and time in ISO format, galvatar - default avatar hash, avatar - avatar image, signature - public name and number, userId - unique numeric user identifier, secondaryId - unique numeric mail account identifier, date - server current date and time in ISO format, hash - temporary user hash, secondaryIdHash - temporary secondaryId hash, loginHash - signature based on user email and secret key in portal)

Response - User Logged in

Example response for getting token request
{
   "result":{
      "config":{
         "logout":"https://konto.onet.pl/checkSSO/logout.html?client_id=blic.rs.front"
      },
      "data":{
         "login":"tom.kowlasky@gmail.com",
         "userId":90103473,
         "userUUID":"26d9f33e-668a-7ab6-e053-4628ae0ad189",
         "loginHash":"69ebccb6bb78372d96e90350be2a678b56cde32c30fa9884be12c8c8207e36f70e71339c2b4bbf2e2a6880ae79ab7aed84d48ae1232a64238cab96018efbd59e",
         "signature":{
            "number":"1",
            "name":"tomkowalsky"
         }
      }
   }
}

Response - User not Logged in

Example response for getting token request
{
   "result":{
      "config":{
         "login":"https://konto.onet.pl/checkSSO/login.html?client_id=blic.rs.front"

      }
   }
}

Errors handling

  • 503 SERVICE UNAVAILABLE - configuration not loaded yet