Renamed scripts to .mjs to follow ES module convention.
This commit is contained in:
21
bin/interactive-login.mjs
Executable file
21
bin/interactive-login.mjs
Executable file
@@ -0,0 +1,21 @@
|
||||
import { loginInteractive } from "../src/auth.js";
|
||||
import { config } from "../public-config.js";
|
||||
|
||||
const scopes = ["https://management.azure.com/.default"];
|
||||
|
||||
let token;
|
||||
|
||||
try {
|
||||
token = await loginInteractive({
|
||||
tenantId: config.tenantId,
|
||||
clientId: config.clientId,
|
||||
scopes,
|
||||
});
|
||||
} catch (e) {
|
||||
console.error("Login failed:", e);
|
||||
console.error(e.stack);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log("Access token acquired:");
|
||||
//console.log(token.accessToken);
|
||||
Reference in New Issue
Block a user