mirror of
https://github.com/azure/login.git
synced 2026-06-08 15:17:04 +00:00
changes
This commit is contained in:
parent
2c7bca8d87
commit
5198b17136
2 changed files with 8 additions and 4 deletions
|
|
@ -192,7 +192,6 @@ function main() {
|
|||
}
|
||||
catch (error) {
|
||||
if (!isAzCLISuccess) {
|
||||
core.error("CLI error:" + error);
|
||||
core.error("Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows");
|
||||
}
|
||||
else {
|
||||
|
|
@ -214,15 +213,18 @@ function executeAzCliCommand(command, silent, execOptions = {}, args = []) {
|
|||
yield exec.exec(`"${azPath}" ${command}`, args, execOptions);
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(error);
|
||||
throw new Error("CLI error:" + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
function jwtParser(federatedToken) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let tokenPayload = federatedToken.split('.')[1];
|
||||
console.log(tokenPayload);
|
||||
let bufferObj = Buffer.from(tokenPayload, "base64");
|
||||
console.log(bufferObj);
|
||||
let decodedPayload = JSON.stringify(bufferObj.toString("utf8"));
|
||||
console.log(decodedPayload);
|
||||
return [decodedPayload["iss"], decodedPayload["sub"]];
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,6 @@ async function main() {
|
|||
}
|
||||
catch (error) {
|
||||
if (!isAzCLISuccess) {
|
||||
core.error("CLI error:" + error);
|
||||
core.error("Az CLI Login failed. Please check the credentials. For more information refer https://aka.ms/create-secrets-for-GitHub-workflows");
|
||||
}
|
||||
else {
|
||||
|
|
@ -210,14 +209,17 @@ async function executeAzCliCommand(
|
|||
await exec.exec(`"${azPath}" ${command}`, args, execOptions);
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(error);
|
||||
throw new Error("CLI error:" + error);
|
||||
}
|
||||
}
|
||||
async function jwtParser(federatedToken) {
|
||||
|
||||
let tokenPayload= federatedToken.split('.')[1];
|
||||
console.log(tokenPayload);
|
||||
let bufferObj = Buffer.from(tokenPayload, "base64");
|
||||
console.log(bufferObj);
|
||||
let decodedPayload = JSON.stringify(bufferObj.toString("utf8"));
|
||||
console.log(decodedPayload);
|
||||
return [decodedPayload["iss"],decodedPayload["sub"]];
|
||||
}
|
||||
main();
|
||||
Loading…
Add table
Add a link
Reference in a new issue