Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar
Rising Star

Here is a self explanatory tutorial. The official Cloudbreak documentation explains how to retrieve your Cloudbreak token via curl or python (see here).

I have been playing with Node.JS on my side, so here is how to do it in Node.JS using request:

process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;

var request = require("request");

var options = { method: 'POST',
  url: 'https://[YOUR_CB_URL]/identity/oauth/authorize',
  qs: 
   { response_type: 'token',
     client_id: 'cloudbreak_shell',
     'scope.0': 'openid',
     source: 'login',
     redirect_uri: 'http://cloudbreak.shell',
     accept: 'application/x-www-form-urlencoded' },
  headers: 
   { 'Content-Type': 'application/x-www-form-urlencoded',
     accept: 'application/x-www-form-urlencoded' },
     body: 'credentials={"username":"[YOUR_USER]","password":"[YOUR_PASSWORD]"' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);
  const querystring = require('querystring');

  console.log(querystring.parse(response.headers['location'])['access_token']);
});
1,130 Views
Version history
Last update:
‎01-17-2019 06:10 PM
Updated by:
Contributors