mirror of
https://github.com/azure/login.git
synced 2026-06-08 09:17:07 +00:00
removing token logs
This commit is contained in:
parent
8bee74f729
commit
00b6505647
2 changed files with 6 additions and 27 deletions
20
lib/main.js
20
lib/main.js
|
|
@ -1,14 +1,14 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function (o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
||||
}) : (function (o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function (o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
}) : function (o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
|
|
@ -144,8 +144,6 @@ function main() {
|
|||
else {
|
||||
throw new Error("Could not get ID token for authentication.");
|
||||
}
|
||||
let [issuer, subjectClaim] = yield jwtParser(federatedToken);
|
||||
console.log("Federated token details: \n issuer- " + issuer + " \n subject claim - " + subjectClaim);
|
||||
}
|
||||
// Attempting Az cli login
|
||||
if (environment == "azurestack") {
|
||||
|
|
@ -232,12 +230,4 @@ function executeAzCliCommand(command, silent, execOptions = {}, args = []) {
|
|||
yield exec.exec(`"${azPath}" ${command}`, args, execOptions);
|
||||
});
|
||||
}
|
||||
function jwtParser(federatedToken) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let tokenPayload = federatedToken.split('.')[1];
|
||||
let bufferObj = Buffer.from(tokenPayload, "base64");
|
||||
let decodedPayload = JSON.parse(bufferObj.toString("utf8"));
|
||||
return [decodedPayload['iss'], decodedPayload['sub']];
|
||||
});
|
||||
}
|
||||
main();
|
||||
|
|
|
|||
13
src/main.ts
13
src/main.ts
|
|
@ -25,8 +25,7 @@ async function main() {
|
|||
error = error.slice(5);
|
||||
}
|
||||
// printing error
|
||||
if (error && error.trim().length !== 0)
|
||||
{
|
||||
if (error && error.trim().length !== 0) {
|
||||
commandStdErr = true;
|
||||
core.error(error);
|
||||
}
|
||||
|
|
@ -123,8 +122,6 @@ async function main() {
|
|||
else {
|
||||
throw new Error("Could not get ID token for authentication.");
|
||||
}
|
||||
let [issuer, subjectClaim] = await jwtParser(federatedToken);
|
||||
console.log("Federated token details: \n issuer- " + issuer + " \n subject claim - " + subjectClaim);
|
||||
}
|
||||
|
||||
// Attempting Az cli login
|
||||
|
|
@ -230,12 +227,4 @@ async function executeAzCliCommand(
|
|||
execOptions.silent = !!silent;
|
||||
await exec.exec(`"${azPath}" ${command}`, args, execOptions);
|
||||
}
|
||||
async function jwtParser(federatedToken: string) {
|
||||
|
||||
let tokenPayload = federatedToken.split('.')[1];
|
||||
let bufferObj = Buffer.from(tokenPayload, "base64");
|
||||
let decodedPayload = JSON.parse(bufferObj.toString("utf8"));
|
||||
return [decodedPayload['iss'], decodedPayload['sub']];
|
||||
}
|
||||
|
||||
main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue