Page 1 of 1

problem to acces the admin page.

Posted: Mon Feb 04, 2013 5:49 am
by EL AMMARIA
Hello;

I started the admin site as discribed in http://docs.broadleafcommerce.org/curre ... arted.html , but i can't acces to the adresse http://localhost:8081/admin.
note that i have no problem with the application 'site'.

thanks for your help

Re: problem to acces the admin page.

Posted: Tue Feb 05, 2013 11:13 am
by phillipuniverse
The admin runs on a different port and over https. Try going to https://localhost:8444/admin.

Re: problem to acces the admin page.

Posted: Tue Feb 05, 2013 11:17 am
by phillipuniverse
I am updating the documentation. Technically it is correct because the admin listens over port 8081 for http requests, but by default we require the admin to use https. It's possible that your browser is not redirecting you to https properly.

Re: problem to acces the admin page.

Posted: Tue Feb 05, 2013 12:09 pm
by lmikula
I just tried it, but get the same as on 8081 port ...
I get the login screen and "invalid login/password" while entering admin:admin

EDIT: looks like it doesn't work with hsqldb out of the box (i have cloned the master repo of demosite, imported it into eclipse, ran as maven install and jetty-demo).
With DEBUG logging i'm getting:

Code: Select all

[artifact:mvn] [DEBUG] 19:58:44 UsernamePasswordAuthenticationFilter - Request is to process authentication
[artifact:mvn] [DEBUG] 19:58:44 ProviderManager - Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider
[artifact:mvn] [DEBUG] 19:58:44 EhcacheGeneralDataRegion - key: sql: select adminuseri0_.ADMIN_USER_ID as ADMIN1_109_, adminuseri0_.ACTIVE_STATUS_FLAG as ACTIVE2_109_, adminuseri0_.EMAIL as EMAIL109_, adminuseri0_.LOGIN as LOGIN109_, adminuseri0_.NAME as NAME109_, adminuseri0_.PASSWORD as PASSWORD109_, adminuseri0_.PHONE_NUMBER as PHONE7_109_, adminuseri0_1_.SANDBOX_ID as SANDBOX1_110_ from BLC_ADMIN_USER adminuseri0_ left outer join BLC_ADMIN_USER_SANDBOX adminuseri0_1_ on adminuseri0_.ADMIN_USER_ID=adminuseri0_1_.ADMIN_USER_ID where adminuseri0_.LOGIN=?; parameters: ; named parameters: {userName=admin}
[artifact:mvn] [DEBUG] 19:58:44 EhcacheGeneralDataRegion - key: BLC_ADMIN_USER
[artifact:mvn] [DEBUG] 19:58:44 EhcacheGeneralDataRegion - Element for key BLC_ADMIN_USER is null
[artifact:mvn] [DEBUG] 19:58:44 EhcacheGeneralDataRegion - key: BLC_ADMIN_USER_SANDBOX
[artifact:mvn] [DEBUG] 19:58:44 EhcacheGeneralDataRegion - Element for key BLC_ADMIN_USER_SANDBOX is null
[artifact:mvn] [DEBUG] 19:58:44 DaoAuthenticationProvider - User 'admin' not found
[artifact:mvn] [DEBUG] 19:58:44 UsernamePasswordAuthenticationFilter - Authentication request failed: org.springframework.security.authentication.BadCredentialsException: Bad credentials
[artifact:mvn] [DEBUG] 19:58:44 UsernamePasswordAuthenticationFilter - Updated SecurityContextHolder to contain null Authentication
[artifact:mvn] [DEBUG] 19:58:44 UsernamePasswordAuthenticationFilter - Delegating to authentication failure handler org.broadleafcommerce.openadmin.security.BroadleafAdminAuthenticationFailureHandler@269bfded

Re: problem to acces the admin page.

Posted: Tue Feb 05, 2013 4:04 pm
by phillipuniverse
This definitely works with HSQL out of the box. One possible scenario is that you need both the site and admin running at the same time. By default, when the site starts up, it starts with its ddl set to 'create-drop' and has a fair amount of import SQL that is run (see development.properties). Since it is set to 'create-drop' those import sql files are run on startup, but on shutdown the database is dropped. So if you then start up the admin after shutting down the site, there won't be any of the admin users in the database (or any other tables).

Verify that there are actually users in BLC_ADMIN_USER.

Re: problem to acces the admin page.

Posted: Wed Feb 06, 2013 3:28 am
by lmikula
Oh yeah thanks for clarifying.
I realized that after migrating to postgres.
Would be worth mentioning it on the getting started page (it could save some hair pulling :D)