Problem with the authentication examples

83 views
Skip to first unread message

Plamen

unread,
Jun 20, 2011, 8:56:46 AM6/20/11
to Sandbar Library
Hello,

I have a problem with form authenitication in Sandbar and looked in
it's examples (auth.clj and form_auth.clj) to see if I make a mistake
somewhere. But then - the examples don't work - when I click on
"Member Data", the I can enter the "member/member" user/pwd but then
the example doesn't return to the at the beginning requested page but
redirects to a "/login" where I again see the login form without data.
From some debugging I see, that the DemoAdapter actually merges the
role "member" to the result. I use the 0.4.0-SNAPSHOT version. Tried
also the 0.3 stable, but with the same result.

I see from the code about the :login-page parameter, but even when I
set it, I land in the login page.

I'm sure it's a noob error and any help would be highly appreciated.

Regards
Plamen

Brenton

unread,
Jun 20, 2011, 9:27:20 AM6/20/11
to Sandbar Library
Plamen,

Thank you for noticing that. I have fixed the problem with the
example. I hope this helps you to find your problem.

Brenton

Plamen

unread,
Jun 20, 2011, 10:17:54 AM6/20/11
to Sandbar Library
A lot of thanks, now it works.

With best regards
Plamen

Julian Gamble

unread,
Oct 24, 2012, 7:59:47 AM10/24/12
to sandbar...@googlegroups.com
Hi Brenton, 

Thanks for your work on the sandbar library. It looks like you've had the opportunity to work on lots of interesting projects along the way. 

Perhaps there is an opportunity to improve the documentation for your sandbar examples - just from  a quick start perspective. 

I figured most of the below out from reading your code. Hopefully all of your intended users shouldn't have to do that. 


Cheers

Julian


Suggestions for Brenton's page here:

https://github.com/brentonashworth/sandbar/wiki/Examples


1. Delete the reference to configuring mysql - as you say you've removed it here:

https://groups.google.com/forum/?fromgroups=#!msg/sandbar-library/MqefAsEkcLE/f3yjBkvY0NoJ


2.  Remove the following unnecessary git commands:

git branch --track stable origin/stable

$ git checkout stable


3. Remove the line

 cd examples


4. Change the project.clj to move the following lines out of dev dependencies and into dependencies so the repl will work:

  [ring/ring-devel "1.0.1"]

  [ring/ring-jetty-adapter "1.0.1"]

  [ring/ring-httpcore-adapter "0.3.5"]


5. Change the load line to something like:

(load-file "src/examples/all/simple_before.clj")


6. Then to start it run:

(examples.all.simple-before/run)


7. Then go to 

http://localhost:8080/

See the page come up - but note that the link is broken


8. Now do Control-C to stop it (there is a better way to do this). Then quit to exit. Then lein repl to start it again. 


9. Now run to load the next example:

(load-file "src/examples/all/simple.clj")


10. Then to start it type:

(examples.all.simple/run)


11. Then go look at:

http://localhost:8080/

and click 'add a new user'


12. At the login prompt, enter login name and password to login and see an access denied

user/user 


13. Click log out


14. Enter admin/admin to login and add a user name


15. Enter a user name and click save

Bob

16. Logout

Reply all
Reply to author
Forward
0 new messages