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

Cannot create a new application using the same name #56

Closed
KostiantynDrozd-okta opened this issue Nov 5, 2020 · 5 comments · Fixed by #64
Closed

Cannot create a new application using the same name #56

KostiantynDrozd-okta opened this issue Nov 5, 2020 · 5 comments · Fixed by #64

Comments

@KostiantynDrozd-okta
Copy link

Steps to reproduce:

  1. Create Angular + Okta, using okta start command
    Run command : okta apps create

Use application name of existing application - okta-angular-sample
Change application type and URI's

Result:

HTTP 400, Okta E0000001 (Api validation failed: label - label: An active OpenID Connect Client instance with the label "okta-angular-sample " already exists.), ErrorId oaePTQoIXOWSI29R3BekDk7yw

@bdemers bdemers changed the title Get and ERROR, when try to edit existing Okta organization Application. Ubuntu 20.04.1 LTS Cannot create a new application using the same name Nov 5, 2020
@bdemers
Copy link
Contributor

bdemers commented Nov 5, 2020

I'm not sure there is much we can do about this other than returning a better error message
i.e. something like:

The Okta CLI does not support changing the application type of existing applications:

@KostiantynDrozd-okta
Copy link
Author

@bdemers
So we also have no way to edit configuration for existing app?

@KostiantynDrozd-okta
Copy link
Author

@bdemers
Today I got java.lang.NullPointerException.
Steps to reproduce:
register a new account - okta register
create okta-spring-boot-sample - okta start
create okta-angular-sample - okta start
run okta apps create
use application name of existing application - okta-angular-sample

See attached terminal-output.txt for more info details
terminal-output.txt

@bdemers
Copy link
Contributor

bdemers commented Nov 6, 2020

Copied error output inline:

okta register
First name: Kostya
Last name: Drozdov
Email address: testkostyadrozdov@gmail.com
Company: test
Creating new Okta Organization, this may take a minute:
OrgUrl: https://dev-5320167.okta.com
An email has been sent to you with a verification code.

Check your email
Verification code: 153775
New Okta Account created!
Your Okta Domain: https://dev-5320167.okta.com
To set your password open this link:
https://dev-5320167.okta.com/welcome/drpKiEwaNm3VT9WQvmsn
kostya@kostya-VirtualBox:~/Downloads$ okta start
Select a sample
> 1: Spring Boot + Okta
> 2: Vue + Okta
> 3: ASP.net Core 3  MVC
> 4: Angular + Okta
Enter your choice [Spring Boot + Okta]: 1
Configuring a new OIDC Application, almost done:
Created OIDC application, client-id: 0oakcx96bXgDOcPqt5d5

Change the directory:
    cd okta-spring-boot-sample

Okta configuration written to: src/main/resources/application.properties
Don't EVER commit src/main/resources/application.properties into source control

Run this application with:
    ./mvnw spring-boot:run

kostya@kostya-VirtualBox:~/Downloads$ okta start
Select a sample
> 1: Spring Boot + Okta
> 2: Vue + Okta
> 3: ASP.net Core 3  MVC
> 4: Angular + Okta
Enter your choice [Spring Boot + Okta]: 4
Configuring a new OIDC Application, almost done:
Created OIDC application, client-id: 0oake086bKCFjULWr5d5
/
Change the directory:
    cd okta-angular-sample

Okta configuration written to: .okta.env

Build this example using NPM:

    npm install

And run with:

    npm start

kostya@kostya-VirtualBox:~/Downloads$ okta apps
0oakcx96bXgDOcPqt5d5	okta-spring-boot-sample
0oake086bKCFjULWr5d5	okta-angular-sample
kostya@kostya-VirtualBox:~/Downloads$ okta apps create
Application name [Downloads]: okta-angular-sample
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:
\
java.lang.NullPointerException
	at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
	at java.util.concurrent.ConcurrentHashMap.putAll(ConcurrentHashMap.java:1089)
	at java.util.Properties.putAll(Properties.java:1347)
	at com.okta.cli.common.config.PropertiesFilePropertiesSource.addProperties(PropertiesFilePropertiesSource.java:46)
	at com.okta.cli.common.service.DefaultSetupService.createOidcApplication(DefaultSetupService.java:211)
	at com.okta.cli.common.service.SetupService.createOidcApplication(SetupService.java:72)
	at com.okta.cli.commands.apps.AppsCreate.createWebApp(AppsCreate.java:114)
	at com.okta.cli.commands.apps.AppsCreate.call(AppsCreate.java:85)
	at com.okta.cli.commands.apps.AppsCreate.call(AppsCreate.java:45)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1783)
	at picocli.CommandLine.access$900(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2150)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2144)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2108)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1975)
	at picocli.CommandLine.execute(CommandLine.java:1904)
	at com.okta.cli.OktaCli.run(OktaCli.java:64)
	at com.okta.cli.OktaCli.main(OktaCli.java:54)
kostya@kostya-VirtualBox:~/Downloads$ ls -a
.  ..  okta-angular-sample  okta-spring-boot-sample

@bdemers
Copy link
Contributor

bdemers commented Nov 6, 2020

@KostiantynDrozd-okta Currently there is no way to edit an app's configuration through the CLI,
That feature is tracked under: #51

bdemers added a commit that referenced this issue Nov 19, 2020
The root cause of this is a limitation in the Java Properties file handling of null value properties, those are explicitly excluded now
This is an edge case, but it could come up in _valid_ use cases when a web app is switched to use PKCE (without a secret)

Fixes: #56
bdemers added a commit that referenced this issue Nov 20, 2020
The root cause of this is a limitation in the Java Properties file handling of null value properties, those are explicitly excluded now
This is an edge case, but it could come up in _valid_ use cases when a web app is switched to use PKCE (without a secret)

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

Successfully merging a pull request may close this issue.

2 participants