jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.5k stars 4.02k forks source link

Cannot sign in with default admin:admin and user:user after generated Jhipster api gateway #9255

Closed patrickHub closed 5 years ago

patrickHub commented 5 years ago

Here is all the detail on generated api gateway with the jhipster info command . Please help

`INFO! Using JHipster version installed locally in current project's node_modules INFO! Executing jhipster:info INFO! Options: from-cli: true Welcome to the JHipster Information Sub-Generator

JHipster Version(s)
genevahotel@0.0.0 B:\Jhispter Build and Deploy Spring Boot Microservice\projects
`-- generator-jhipster@5.7.2
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
    "generator-jhipster": {
        "promptValues": {
            "packageName": "com.patrickhub.genevahotel"
        },
        "jhipsterVersion": "5.7.2",
        "applicationType": "gateway",
        "baseName": "genevahotel",
        "packageName": "com.patrickhub.genevahotel",
        "packageFolder": "com/patrickhub/genevahotel",
        "serverPort": "8080",
        "authenticationType": "jwt",
        "cacheProvider": "hazelcast",
        "enableHibernateCache": false,
        "websocket": false,
        "databaseType": "sql",
        "devDatabaseType": "h2Disk",
        "prodDatabaseType": "postgresql",
        "searchEngine": false,
        "messageBroker": false,
        "serviceDiscoveryType": "eureka",
        "buildTool": "gradle",
        "enableSwaggerCodegen": false,
        "jwtSecretKey": "",
        "clientFramework": "angularX",
        "useSass": false,
        "clientPackageManager": "npm",
        "testFrameworks": [],
        "jhiPrefix": "jhi",
        "otherModules": [],
        "enableTranslation": false
    }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Environment and Tools

java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

git version 2.11.0.windows.1

node: v10.13.0

npm: 6.4.1

yeoman: 1.8.5

yarn: 1.13.0

Docker version 1.13.0, build 49bf474

docker-compose version 1.10.0, build 4bd6f1a0

`

gmarziou commented 5 years ago

Few questions:

Also, "\Jhispter Build and Deploy Spring Boot Microservice\projects" is a very long path and could expose you to errors on Windows.

patrickHub commented 5 years ago

When I started jhipster registry , it discouvert the api gateway with a status down I don't know why i get a status down instead of status up. I re-generated one's again but still have the same problem.

gmarziou commented 5 years ago

What about my 2nd question?

patrickHub commented 5 years ago

I locked at browser console and i get not found 404 response after trying to sign in with admin: admin and notihng in server logs

gmarziou commented 5 years ago

404 for which url and HTTP method? Please give details, copy/paste text or a screenshot.

patrickHub commented 5 years ago

POST http://localhost:9000/api/authenticate 404 (Not Found)

pascalgrimaud commented 5 years ago

You need to provide more information to reproduce:

Like this, it is impossible to help.

gmarziou commented 5 years ago

I took your .yo-rc.json, generated a gateway, started it with gradlew and did not have any problem to authenticate on http://localhost:8080 and no problem as well on http://localhost:9000 when running webpack dev server with npm run start

pascalgrimaud commented 5 years ago

Let's close this as we can't reproduce

xniti3x commented 2 years ago

you can reproduce the issue if you generate a (standard) jhipster project in gitpod.io i get the exact same problem , cant login with default credentials admin/admin or user/user

terminal: 2021-11-02 19:30:58.806 WARN 2212 --- [ XNIO-1 task-1] o.z.problem.spring.common.AdviceTraits : Unauthorized: Full authentication is required to access this resource 2021-11-02 19:30:58.808 WARN 2212 --- [ XNIO-1 task-1] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource]

browser console: GET https://8080-cyan-flamingo-user73s0aai.ws-eu17.gitpod.io/api/account 401 zone.js:2863 GET https://8080-cyan-flamingo-user73s0aai.ws-eu17.gitpod.io/manifest.webapp 401 manifest.webapp:1

when i tried it on local environment it works fine.

freemo commented 1 year ago

I had this same issue in 2023, happens on all my computers and on all newly generated projects.

The issue with these specific symptoms happens when you are running through docker and dont have "keycloak" in your hosts file and resolving to localhost. Once I added that everything worked.

scarabetta commented 8 months ago

I forgot I've added keycloak to my hosts file, thus I needed to navigate to "http://keycloack:8080" instead of localhost, and it worked