If you're being redirected to:
http://localhost:4/login?&login_failed=Y&username=lawrence
Then the problem is that you're not using the credentials for one of the users
you've specified (e.g. "root" or "jane").
- Chas
On Jan 17, 2013, at 1:43 PM, larry google groups wrote:
>
> Ho
How should I debug this? What questions should I ask?
At this point, for the sake of debugging, I have everything in one
file, in one name space. I have recreated the dummy users database:
(def users {"root"{:username "lawrence"
:password (creds/hash-bcrypt "admin_password")
On Jan 16, 2013, at 12:03 PM, larry google groups wrote:
> I am ignorant about the implications of using :: to namespace vars.
> The fact that I have ::admin in one namespace:
>
>:users {"root"{:username "lawrence"
> :password (creds/hash-bcrypt "admin_password")
>
I am ignorant about the implications of using :: to namespace vars.
The fact that I have ::admin in one namespace:
:users {"root"{:username "lawrence"
:password (creds/hash-bcrypt "admin_password")
:roles #{::admin}
:created_at "2013-01-08 1
I am getting closer, I think. I changed the keys from keywords to
strings and that seemed to let me login. But if I go to /logout, I
get:
2013-01-16 11:37:25.875:WARN:oejs.AbstractHttpConnection:/logout
java.lang.ClassCastException: java.lang.String cannot be cast to
clojure.lang.IPersistentMap
Oh, I think I figured this out. I re-read this:
https://github.com/cemerick/friend/#authentication
And I see the keys here are strings:
(def users {"root" {:username "root"
:password (creds/hash-bcrypt "admin_password")
:roles #{::admin}}
"jane
I realize this is name space qualified:
::admin
::user
I'm actually referencing these in my core namespace, though the user
info is defined in (def fake-data ;; big map of fake data) which is in
a different name space. I am not sure how that would effect the way
Friend interprets the data.
On
>
> You're still not using wrap-keyword-params.
>
Thanks. I changed the routes so I now have:
(def app
(-> app-routes
(friend/authenticate {:credential-fn (partial creds/bcrypt-
credential-fn (:users @interactions))
:workflows [(workflows/interactive-
for
On Jan 16, 2013, at 9:07 AM, larry google groups wrote:
>
> I define a var with user info like this:
>
> (ns kiosks-clojure.fake-data-for-development
> (:require [cemerick.friend :as friend]
>(cemerick.friend [workflows :as workflows]
> [credentials :as c
I define a var with user info like this:
(ns kiosks-clojure.fake-data-for-development
(:require [cemerick.friend :as friend]
(cemerick.friend [workflows :as workflows]
[credentials :as creds])))
(def fake-data
{
:users {:root {:username "la...@wonde
I define a var with user info like this:
(ns kiosks-clojure.fake-data-for-development
(:require [cemerick.friend :as friend]
(cemerick.friend [workflows :as workflows]
[credentials :as creds])))
(def fake-data
{
:users {:root {:username "la...@wonde
>
> Are you using the keyword-params middleware? It's not in the code you
> initially provided, and you don't mention adding it after seeing the note
> about it being required. If you are submitting a value for the
>`username` parameter to /login, but the failure redirect does not echo
>that user
On Jan 16, 2013, at 1:45 AM, larry google groups wrote:
> For anyone else who might make the same mistake I did, I changed this:
>
> (GET "/admin" request (friend/authorize #{::admin} (admin
> request)))
>
> to this:
>
> (GET "/admin" request (friend/authorize #{::admin} {} (admin
> request)
For anyone else who might make the same mistake I did, I changed this:
(GET "/admin" request (friend/authorize #{::admin} (admin
request)))
to this:
(GET "/admin" request (friend/authorize #{::admin} {} (admin
request)))
adding an empty map before the string that is my actual HTML page.
Th
Looking here:
https://github.com/cemerick/friend/blob/master/src/cemerick/friend.clj
I see in the stacktrace that the problem seems to be with the last
line of this function:
(defn default-unauthenticated-handler
[request]
(-> request
::auth-config
:login-uri
(util/resolve-absol
Reading here:
https://github.com/cemerick/friend
I see this:
(Note that Friend itself requires some core Ring middlewares: params,
keyword-params and nested-params.
I did not have nested-params so I will add this.
This might be a stupid question, but why doesn't Friend include the
Ring middlew
16 matches
Mail list logo