Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apps create check if project matches expected type before continuing #59

Open
KostiantynDrozd-okta opened this issue Nov 11, 2020 · 3 comments

Comments

@KostiantynDrozd-okta
Copy link

KostiantynDrozd-okta commented Nov 11, 2020

Running apps create in an empty directory and creating a Spring Boot application will create a src/main/resources/application.properties while this IS expected. If there is no pom.xml, build.gradle, build.gradle.kts, in that directory it seems odd.

Steps to reproduce:

I created a new Okta account via okta-cli.
Then I run command okta apps create:

okta apps create
Application name [Downloads]: test-app
Type of Application
(The Okta CLI only supports a subset of application types and properties):
> 1: Web
> 2: Single Page App
> 3: Native App (mobile)
> 4: Service (Machine-to-Machine)
Enter your choice [Web]: 1
Type of Application
> 1: Okta Spring Boot Starter
> 2: Spring Boot
> 3: JHipster
> 4: Other
Enter your choice [Other]: 1
Redirect URI
Common defaults:
 Spring Security - http://localhost:8080/login/oauth2/code/okta
 JHipster - http://localhost:8080/login/oauth2/code/oidc
Enter your Redirect URI [http://localhost:8080/login/oauth2/code/okta]: 
Enter your Post Logout Redirect URI [http://localhost:8080/]: 
Configuring a new OIDC Application, almost done:
Created OIDC application, client-id: 0oanrcmrnULlncLNc5d5

Okta application configuration has been written to: /home/kostya/Downloads/src/main/resources/application.properties

Then I found a new application in Developer console, but also in my current directory 'src' folder was created.
Do we need extra description in readme, how okta apps create should work?

@bdemers
Copy link
Contributor

bdemers commented Nov 11, 2020

src/main/resources/application.[properties|yml] is the default configuration file for Spring Boot.
When you select the "Spring Boot" option that file will either be created or updated and include the application configuration.

@KostiantynDrozd-okta
Copy link
Author

But is it OK, if my current directory was not sprint-boot project?
My current directory Downloads folder, and after I run okta apps create then src folder was created in Downloads folder.
Don't we need some check, if current folder spring app or not?

@bdemers bdemers changed the title When User creates a new Okta app, then folder 'src' is created. apps create check if project matches expected type before continuing Nov 12, 2020
@bdemers
Copy link
Contributor

bdemers commented Nov 12, 2020

I see what you are saying now, I tweaked the description of the issue.

To add to my previous edits, we might want to just prompt the user with an

The Okta CLI did not detect a Spring Boot project in this directory, are you sure you want to continue? [Y/n]

Or maybe instead of creating the files, we just dump the properties to the screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants