skip to Main Content
async function authenticateDevice() {
const client_id = '';
const scope = 'offline_access xboxlive.signin xboxlive.offline_access';
const cobrand_id = '8058f65d-ce06-4c30-9559-473c9275a65d';

const data = qs.stringify({
  'client_id': client_id,
  'scope': scope,
  'cobrandid': cobrand_id
});

const config = {
  method: 'post',
  url: 'https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode',
  headers: { 
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  data : data
};

return new Promise((resolve, reject) => {
  axios(config)
    .then(function (response) {
      const data = response.data;
      const usercode = data.user_code.toString();
      resolve(usercode);
    })
    .catch(function (error) {
      console.log(error);
      reject(error);
    });
})}

I want to add a cobrand id to it. But when I use the usercode I got from this code, the cobrand id is not applied properly as shown in the first picture.

I’m making a minecraft launcher. I’ve written the code so that I can log in to the launcher with my microsoft account using device code like multimc. It’s not impossible as you can see in the second picture above. I’m asking because I can’t find anything about cobrand id anywhere.

first

second

2

Answers


  1. Chosen as BEST ANSWER

    https://github.com/PrismarineJS/prismarine-auth

    see here to resolve this issue.


  2. Ensure that the cobrand ID is in the correct format and adheres to any specific requirements set by Microsoft.also Double-check the value of cobrand_id to make sure it’s valid.
    Try this document below for more info

    https://learn.microsoft.com/en-us/answers/questions/1258674/how-to-use-microsoft-identity-platform-and-oauth-2

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search