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

jhipster heroku still prompts for credentials when Answer is No to Okta #16299

Closed
mraible opened this issue Sep 15, 2021 · 7 comments · Fixed by #16306
Closed

jhipster heroku still prompts for credentials when Answer is No to Okta #16299

mraible opened this issue Sep 15, 2021 · 7 comments · Fixed by #16306
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: Heroku $100 https://www.jhipster.tech/bug-bounties/
Milestone

Comments

@mraible
Copy link
Contributor

mraible commented Sep 15, 2021

Overview of the issue

You're prompted for credentials even when you say No to Okta when running jhipster heroku.

Screen Shot 2021-09-14 at 7 58 58 PM

Motivation for or Use Case

I don't think you should be prompted for the JHipster Admin email or password when you say No to Okta.

Reproduce the error

Run jhipster heroku and say No to Okta.

JHipster Version(s)
[email protected] /Users/mraible/dev/auth0-jhipster-example
└── [email protected]

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "baseName": "gallery",
    "jhipsterVersion": "7.2.0",
    "skipClient": false,
    "skipServer": false,
    "skipUserManagement": true,
    "skipCheckLengthOfIdentifier": false,
    "skipFakeData": false,
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "testFrameworks": ["cypress"],
    "blueprints": [],
    "otherModules": [],
    "pages": [],
    "creationTimestamp": 1630470306439,
    "serviceDiscoveryType": "no",
    "reactive": false,
    "authenticationType": "oauth2",
    "packageName": "org.jhipster.gallery",
    "serverPort": "8080",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "postgresql",
    "buildTool": "maven",
    "serverSideOptions": [],
    "websocket": false,
    "searchEngine": false,
    "messageBroker": false,
    "enableSwaggerCodegen": false,
    "clientFramework": "react",
    "withAdminUi": true,
    "clientTheme": "none",
    "enableTranslation": true,
    "nativeLanguage": "en",
    "devServerPort": 9060,
    "clientPackageManager": "npm",
    "clientThemeVariant": "",
    "languages": ["en", "pt-br"],
    "entities": ["Album", "Photo", "Tag"],
    "lastLiquibaseTimestamp": 1631670674000,
    "enableGradleEnterprise": false
  }
}
JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
entity Album {
  title String required
  description TextBlob
  created Instant
}
entity Photo {
  title String required
  description TextBlob
  image ImageBlob required
  height Integer
  width Integer
  taken Instant
  uploaded Instant
}
entity Tag {
  name String required minlength(2)
}
relationship ManyToOne {
  Album{user(login)} to User
  Photo{album(title)} to Album
}
relationship ManyToMany {
  Photo{tag(name)} to Tag{photo}
}

paginate Album with pagination
paginate Photo, Tag with infinite-scroll

Environment and Tools

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

git version 2.32.0

node: v14.17.0

npm: 7.22.0

Docker version 20.10.8, build 3967b7d

docker-compose version 1.29.2, build 5becea4c

@mraible mraible added theme: Heroku $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/ and removed area: triage theme: undefined labels Sep 15, 2021
@mraible
Copy link
Contributor Author

mraible commented Sep 15, 2021

It seems that things might not work at all when you answer no. It just hangs at:

Using existing Git repository

Installing Heroku CLI deployment plugin

Creating Heroku application and setting up node environment

@atomfrede
Copy link
Member

atomfrede commented Sep 15, 2021

Fixed the invalid prompt, but there seems to be an issue with heroku create command. It seems to hang even when selecting okta.

EDIT: @mraible can you check your heroku cli version and if you are still logged in with the heroku cli? At least that was not the case on my machine. Will have a look why we don't display it anymore.

atomfrede added a commit to atomfrede/generator-jhipster that referenced this issue Sep 15, 2021
atomfrede added a commit to atomfrede/generator-jhipster that referenced this issue Sep 15, 2021
atomfrede added a commit that referenced this issue Sep 16, 2021
* do not ask for additional okta properties if not selected

updates #16299

* add timeout to check for heroku login status correctly

closes #16299
@mraible
Copy link
Contributor Author

mraible commented Sep 16, 2021

@atomfrede When I choose no for Okta, I still end up with some artifacts in my .yo-rc.json:

    "useOkta": false,
    "oktaAdminPassword": "XXX"

@atomfrede
Copy link
Member

Yes it's the default values.

@mraible
Copy link
Contributor Author

mraible commented Sep 16, 2021

Running jhipster heroku seems to fail after I try to redeploy an existing project.

Configuring Heroku
✖ Error: Command failed: heroku buildpacks:add heroku/java --app protected-reaches-51362
 ›   Error: The buildpack heroku/java is already set on your app.

    at ChildProcess.exithandler (child_process.js:319:12)
    at ChildProcess.emit (events.js:376:20)
    at maybeClose (internal/child_process.js:1055:16)
    at Socket.<anonymous> (internal/child_process.js:441:11)
    at Socket.emit (events.js:376:20)
    at Pipe.<anonymous> (net.js:673:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'heroku buildpacks:add heroku/java --app protected-reaches-51362',
  stdout: '',
  stderr: ' ›   Error: The buildpack heroku/java is already set on your app.\n'

@atomfrede
Copy link
Member

Let me check. It seems heroku has change a little on their side. I think before setting the (same) buildpack again didn't throw such an error.

@pascalgrimaud pascalgrimaud added this to the 7.3.0 milestone Sep 17, 2021
@mraible
Copy link
Contributor Author

mraible commented Sep 20, 2021

I tried this again today and it still writes Okta values to .yo-rc.json, even though I said I didn't want to use Okta.

    "herokuAppName": "flickr-2",
    "herokuDeployType": "git",
    "herokuJavaVersion": "11",
    "useOkta": false,
    "oktaAdminPassword": "d4f70a690cad148c4cac2018c9805adc60393e95"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ theme: Heroku $100 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants