oktadev / okta-aws-cli-assume-role

Okta AWS CLI Assume Role Tool
Apache License 2.0
338 stars 177 forks source link

okta-aws on headless #321

Open ian-barlow opened 5 years ago

ian-barlow commented 5 years ago

Describe the bug jar is built with GUI dependencies and abends on headless systems

To Reproduce Steps to reproduce the behavior:

  1. Install following instructions
  2. run 'okta-aws'

Expected behavior Prompt for missing arguments/configuration

Screenshots headless-server:~$ okta-aws Graphics Device initialization failed for : es2, sw Error initializing QuantumRenderer: no suitable pipeline found java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280) at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243) at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94) at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124) ... 1 more Exception in thread "main" java.lang.RuntimeException: No toolkit found at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:272) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267) at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158) at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658) at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678) at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195) at java.base/java.lang.Thread.run(Thread.java:834)

Additional context Add any other context about the problem here.

jchan172 commented 5 years ago

I am encountering the same issue.

mnatalonicb commented 4 years ago

same here.

jeremyplichtafc commented 4 years ago

Sorry - I have not had much time to dedicate to this recently. I understand this is blocking several people that do not need browser auth. The current reason javafx is used is for organizations that delegate their Okta authentication to other providers like Google, in this case a browser window is needed to perform the authentication and SAML flow. I am thinking of adding a separate maven build profile that will build a jar without these dependencies. Then you would either use the headless, or browserauth jar depending on your needs.

bfleming-ciena commented 4 years ago

I'm having too much trouble getting this installed, so better would be to use a docker container, but I require the web prompt, which I can't do in a docker container. It seems the docs are out of date and the docker container that was used awhile ago is outdated as well.

Any plans to move away from java or to make the install more reliable?

benstrata commented 3 years ago

faced into same issue

jeremyplichtafc commented 3 years ago

For those still experiencing this issue can you paste the java -version you are using and your OS? It seemed to start out as an issue specific for people running linux though this thread has grown quite long and want to be sure.

For what its worth I am running openjdk 11.0.2 on Mac OS X 10.15.7 so will need to verify/troubleshoot on different platforms depending on where people are having the issue

marcocamacho commented 3 years ago

Same issue with java 11 and 14 on Fedora (using okta-aws-cli-2.0.4.jar)

 java -version
openjdk version "14.0.2" 2020-07-14
OpenJDK Runtime Environment AdoptOpenJDK (build 14.0.2+12)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 14.0.2+12, mixed mode, sharing)
$ java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)

$ okta-aws xxx sts get-caller-identity
Graphics Device initialization failed for :  es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
        at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243)
        at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
        at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:678)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
        ... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
marcocamacho commented 3 years ago

Update: I used java 8 with okta-aws-cli-2.0.0.jar and first got:

 java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

...
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/openjfx/rt/lib/amd64/libjfxwebkit.so

After installing the necessary drivers (sudo dnf install mesa-dri-drivers.i686) I got this:

Exception in thread "main" java.lang.UnsupportedOperationException: Internal Error
        at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:158)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)
        at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
        at com.sun.glass.ui.Application.run(Application.java:146)
        at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:278)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
        at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:695)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
        at java.lang.Thread.run(Thread.java:748)

ANOTHER UPDATE: added -Djdk.gtk.verbose=true \ and saw that it was looking for GTK version 3 (trying GTK library libgtk-3.so.0) which solved by doing dnf install libgtk-3.so.0. That made it work for Java 8 with okta-aws-cli-2.0.0.jar. Solving it for java 11+ is still pending.

sebastian8x8 commented 3 years ago

ping @jeremyplichtafc? Is there a plan to make this work for headless? Or is there any workaround for this available?

jeevanandamjobs commented 2 years ago

This solved this issue on windows. edited config.properties (c:\users\.okta)

OktaAWSCLI

OKTA_ORG= OKTA_AWS_APP_URL= OKTA_USERNAME= OKTA_BROWSER_AUTH=false ->> change this to false, by default its true.

alevy22 commented 11 months ago

I did similar thing for mac and it solved the issue as well:

nano ~/.okta/config.properties

# OktaAWSCLI
OKTA_ORG=your-okta-org-url
OKTA_AWS_APP_URL=your-okta-aws-app-url
OKTA_USERNAME=your-okta-username
OKTA_BROWSER_AUTH=false