0
votes

I already have an AWS App that is currently working and I have Java 8 installed. When I tried the onelogin-python-aws-assume-role tool, it worked fine and I was able to login using https://github.com/onelogin/onelogin-python-aws-assume-role

but for some reason the java one doesn't work https://github.com/onelogin/onelogin-aws-cli-assume-role.

I followed all the steps here https://developers.onelogin.com/api-docs/1/samples/aws-cli

1 - I created Developer API Keys, 2 - I updated onelogin.sdk.properties with the API Keys 3 - Downloaded the latest onelogin-aws-cli.jar 4 - Ran "java -jar onelogin-aws-cli.jar --profile master --appid 33333 --subdomain companyname --region eu-west-2 --username myusername"

I then get the following output:

OneLogin AWS Assume Role Tool

15:12:33.727 [main] DEBUG com.onelogin.sdk.util.Settings - properties file onelogin.sdk.properties loaded succesfully Exception in thread "main" OAuthProblemException{error='Unauthorized', description='Authentication Failure', uri='null', state='401', scope='null', redirectUri='null', responseStatus=401, parameters={}} at org.apache.oltu.oauth2.common.exception.OAuthProblemException.error(OAuthProblemException.java:59) at org.apache.oltu.oauth2.client.validator.OAuthClientValidator.validateErrorResponse(OAuthClientValidator.java:63) at org.apache.oltu.oauth2.client.validator.OAuthClientValidator.validate(OAuthClientValidator.java:48) at org.apache.oltu.oauth2.client.response.OAuthClientResponse.validate(OAuthClientResponse.java:127) at com.onelogin.sdk.conn.OneloginOAuthJSONAccessTokenResponse.init(OneloginOAuthJSONAccessTokenResponse.java:24) at org.apache.oltu.oauth2.client.response.OAuthClientResponse.init(OAuthClientResponse.java:101) at org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse.init(OAuthAccessTokenResponse.java:60) at org.apache.oltu.oauth2.client.response.OAuthClientResponse.init(OAuthClientResponse.java:120) at org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory.createCustomResponse(OAuthClientResponseFactory.java:82) at com.onelogin.sdk.conn.OneloginURLConnectionClient.execute(OneloginURLConnectionClient.java:75) at com.onelogin.sdk.conn.Client.getAccessToken(Client.java:168) at com.onelogin.aws.assume.role.cli.OneloginAWSCLI.main(OneloginAWSCLI.java:160)

1

1 Answers

0
votes

I resolved it in the end.. Turns out I used the wrong onelogin.sdk.properties