okta / okta-cli

Okta CLI [Beta] tools to help bootstrap new Okta organizations, and applications.
Apache License 2.0
90 stars 26 forks source link

JHipster option doesn't work with Micronaut blueprint #29

Closed mraible closed 3 years ago

mraible commented 4 years ago

The JHipster option with Okta CLI expects you to be using Spring Boot. That won't always be the case since there's also Node.js, Quarkus, .NET, and Micronaut versions of JHipster. Ideally, our Okta CLI is smart enough to detect the framework used and override the appropriate environment variables. In this case, you could look for generator-jhipster-micronaut in the dependencies.

When I tried okta apps create on this repo and selected JHipster, it writes the following to .okta.env:

export SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET="ZZZ"
export SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI="https://dev-896939.okta.com/oauth2/default"
export SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID="XXX"

Ideally, for Micronaut, it'd write:

MICRONAUT_SECURITY_OAUTH2_CLIENTS_OIDC_OPENID_ISSUER
MICRONAUT_SECURITY_OAUTH2_CLIENTS_OIDC_CLIENT_ID
MICRONAUT_SECURITY_OAUTH2_CLIENTS_OIDC_CLIENT_SECRET
bdemers commented 4 years ago

I'm guessing we should detect dependencies in the pom (or gradle build) 🤔

Maybe one of the following dependencies?

mraible commented 4 years ago

It might be easier to look at package.json for JHipster. If it's a regular JHipster app, it'll have generator-jhipster as a dev dependency. If it's a blueprint, it'll have generator-jhipster-{blueprint-name}. For example, https://github.com/oktadeveloper/okta-jhipster-micronaut-example/blob/master/package.json#L95.

bdemers commented 4 years ago

Perfect!, we could probably start out with basic string matching.

There are a few different backends now right? Spring, Micronaut, and something for .net?)

mraible commented 4 years ago

Yes, there are a few different backend options now:

I haven't tested each of them to see if they work with Okta, but they should all have OIDC support.

mraible commented 3 years ago

Fixed by #83.