jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bharat Agarwal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JCLOUDS-1439) How to connect AWS environment through Multi factor authentication(MFA) in jcloud
Date Fri, 10 Aug 2018 10:00:01 GMT

    [ https://issues.apache.org/jira/browse/JCLOUDS-1439?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16576045#comment-16576045
] 

Bharat Agarwal commented on JCLOUDS-1439:
-----------------------------------------

Thanks Ignasi for prompt response. My piece of code is given below to access the AWS through
MFA but I am getting the POST https://ec2.ap-southeast-1.amazonaws.com/ HTTP/1.1 -> HTTP/1.1
401 Unauthorized Exception. Please let me know what is wrong in the below code.

ComputeServiceContext computeContext = ContextBuilder
 .newBuilder("aws-ec2").credentialsSupplier(new Supplier<Credentials>() {
 
 @Override
 public Credentials get() {
 // TODO Auto-generated method stub
 return SessionCredentials.builder()
 .accessKeyId("accesskey")
 .secretAccessKey("secret key")
 .sessionToken("mfa")
 .expiration(new Date()) // Change to a proper value
 .build();

}
 })
 .endpoint("https://ec2.ap-southeast-1.amazonaws.com")
 .overrides(ec2Properties)
 .buildView(ComputeServiceContext.class);

> How to connect AWS environment through Multi factor authentication(MFA) in jcloud
> ---------------------------------------------------------------------------------
>
>                 Key: JCLOUDS-1439
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1439
>             Project: jclouds
>          Issue Type: Task
>          Components: jclouds-compute
>    Affects Versions: 2.0.3
>            Reporter: Bharat Agarwal
>            Priority: Major
>              Labels: aws-ec2, aws-s3
>             Fix For: 2.0.3
>
>
> Please let us know how to connect AWS environment programmatically in jcloud through
MFA.
> AWS API uses getSessionToken to recieve the AWS MFA. Is there any way to use MFA in jcloud
to access the AWS?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message