Skip to content

Cross-account IAM authentication support #1239

Answered by szantopeter
indyaah asked this question in Q&A
Discussion options

You must be logged in to vote

I had the same issue, and I was able to fix it as simple as

public static void main(String[] args) {

	setStsAssumeRoleCredentialsForJdbcDriver();

	SpringApplication.run(RdspocApplication.class, args);
}

private static void setStsAssumeRoleCredentialsForJdbcDriver() {
	AwsCredentialsManager.setCustomHandler((hostSpec, props) -> {
		StsClient stsClient = StsClient.builder().build();
		
		Logger logger = LoggerFactory.getLogger(RdspocApplication.class);
		logger.info("Setting STS Assume Role Credentials for JDBC Driver with hostSpec: {} and props: {}", hostSpec, props);

		return StsAssumeRoleCredentialsProvider.builder()
				.stsClient(stsClient)
				.refreshRequest(builder -> builder
		…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@indyaah
Comment options

Answer selected by indyaah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants