Skip to content

Supply MSA bearer token directly#1323

Closed
SinanAkkoyun wants to merge 3 commits intoPrismarineJS:masterfrom
SinanAkkoyun:master-msatoken
Closed

Supply MSA bearer token directly#1323
SinanAkkoyun wants to merge 3 commits intoPrismarineJS:masterfrom
SinanAkkoyun:master-msatoken

Conversation

@SinanAkkoyun
Copy link

@SinanAkkoyun SinanAkkoyun commented Aug 30, 2024

This PR enables one to supply the MSA bearer token directly (which simplifies a lot for users who do not want to rely on the cache system)

Dependent on: PrismarineJS/prismarine-auth#108

Enables:

const bot = mineflayer.createBot({
  ...
  auth: 'microsoft',
  msaToken: 'abcd...'
})

@SinanAkkoyun
Copy link
Author

I just realized that the msa token goes invalid after a day or so, so this PR can be closed. I would, however, be very thankful for help on using the createBot session and access token parameters as I was not able to get that working

@SinanAkkoyun
Copy link
Author

I implemented the auth flow for refreshing those tokens (Essential Mod auth flow) and would like to publish and use that code. For that, I would appreciate if this PR could be merged

@SinanAkkoyun SinanAkkoyun reopened this Sep 2, 2024
@rom1504
Copy link
Member

rom1504 commented Jan 24, 2025

thoughts @extremeheat ?

@extremeheat
Copy link
Member

This doesn't seem like a good idea to me. The auth system is designed to internally walk up the dep tree of required tokens refreshing and manage the tokens on its own as needed. Trying to inject things into that process is not good. Not using the cache system should be implemented correctly with a custom cacher.

@rom1504 rom1504 closed this Sep 7, 2025
@github-project-automation github-project-automation bot moved this from Waiting for user input to Closed in PR Triage Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants