You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://gitpod.io/#https://github.com/PrismarineJS/prismarine-auth)
6
6
7
7
Quickly and easily obtain auth tokens to authenticate with Microsoft/Xbox/Minecraft/Mojang
@@ -24,8 +24,6 @@ npm install prismarine-auth
24
24
-[deviceType] {string} - See the [API.md](docs/API.md)
25
25
- onMsaCode {Function} - (For device code auth) What we should do when we get the code. Useful for passing the code to another function.
26
26
27
-
[View more examples](https://github.com/PrismarineJS/prismarine-auth/tree/master/examples)
28
-
29
27
### Examples
30
28
31
29
### getMsaToken
@@ -39,6 +37,15 @@ const flow = new Authflow(userIdentifier, cacheDir)
39
37
flow.getMsaToken().then(console.log)
40
38
```
41
39
40
+
**Note**: By default, this library will authenticate as Minecraft for Nintendo Switch, with a `flow` set to `live`. For non-Minecraft applications you should
41
+
register for Microsoft Azure Oauth token. See https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application for more information on obtaining an Azure token. You then use it with the `msal` flow like this:
If `flow` is `live`, the default, then you can only specify existing Microsoft client IDs. This library exposes some default Microsoft client IDs under the exported `Titles` object. See the [types](./index.d.ts) for more information.
if(!this.options.authTitle)thrownewError('Must specify an Azure client ID token inside the `authTitle` parameter when using Azure-based auth. See https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application for more information on obtaining an Azure token.')
Copy file name to clipboardExpand all lines: src/TokenManagers/MsaTokenManager.js
+1-1
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,7 @@ class MsaTokenManager {
127
127
resolve(response)
128
128
})
129
129
}).catch((error)=>{
130
-
console.warn('[msa] Error getting device code')
130
+
console.warn('[msa] Error getting device code. Ensure your supplied `authTitle` token (or clientId in your supplied MSAL config) is valid and that it has permission to do non-interactive code based auth.')
0 commit comments