Skip to content

Commit c3212ea

Browse files
authored
Merge pull request #108 from cloudgraphdev/feat/mfa-support
feat(auth): support mfa based auth
2 parents 68e023b + 6c81f60 commit c3212ea

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/services/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,18 @@ export default class Provider extends CloudGraph.Client {
310310
if (profile && profile !== 'default') {
311311
let creds: AWS.Credentials
312312
const credsFunction = fromIni({
313-
profile
313+
profile,
314+
// MFA token support
315+
mfaCodeProvider: async () => {
316+
const { mfaToken = '' }: { mfaToken: string } = await this.interface.prompt([
317+
{
318+
type: 'input',
319+
message: `Please enter the MFA token for ${profile}`,
320+
name: 'mfaToken'
321+
},
322+
])
323+
return mfaToken
324+
}
314325
})
315326
if (creds) {
316327
sts = new AWS.STS({ credentials: await credsFunction() })

0 commit comments

Comments
 (0)