aboutsummarylogtreecommitdiffstats
path: root/okta-credential_process
blob: cd0bd70f534c7660eec32351de39e0e327837f92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
roleARN="$1"
shift
if [ -n "$https_proxy" ]; then
  readonly URI_REGEX='^(([^:/?#]+):)?(//((([^:/?#]+)@)?([^:/?#]+)(:([0-9]+))?))?(/([^?#]*))(\?([^#]*))?(#(.*))?'
  [[ $https_proxy =~ ${URI_REGEX} ]] && PROXY_CONFIG="-Dhttps.proxyHost=${BASH_REMATCH[7]} -Dhttps.proxyPort=${BASH_REMATCH[9]}"
fi
env OKTA_AWS_ROLE_TO_ASSUME="$roleARN" \
  /usr/lib/jvm/java-11-openjdk/bin/java ${PROXY_CONFIG} \
  -Djava.util.logging.config.file=/usr/share/java/okta-aws-cli/logging.properties \
  -classpath /usr/share/java/okta-aws-cli/okta-aws-cli.jar \
  com.okta.tools.CredentialProcess