Hi, It should work with all these versions.
The pac4j and buji-pac4j library are meant to work for many identity providers and *several ones at the same time*. So that's why you have two main concepts: - a client (like FacebookClient, TwitterClient...) defines a way to authenticate via an identity provider (like Facebook, Twitter...) - the Clients class is a way to group all the clients on the same callback url (the idea is to have a /callback url with a specific parameter instead of /callbackFacebook, /callbackTwitter... urls). And the *ClientFilter* and *ClientRealm* work with *Clients*, not client directly: would you mind checking that? Thanks. Best regards, Jérôme LELEU Founder of CAS in the cloud: www.casinthecloud.com | Twitter: @leleuj Chairman of CAS: www.jasig.org/cas | Creator of pac4j: www.pac4j.org 2014-07-14 0:01 GMT+02:00 Frederik [via Shiro User] < [email protected]>: > Hi, > > I didn't manage to use Spring myself, so after some Googling I arrived at > this post that says it should be possible. > But even with the exact same config as posted above, it doesn't work... > > First error I receive with the example above is: > "org.pac4j.core.exception.TechnicalException: callbackUrl cannot be blank" > This can easily be overcome by fixing the culprit bean config like this: > > <bean id="facebookClient" class="org.pac4j.oauth.client.FacebookClient"> > <constructor-arg name="key" value="myAppId" /> > <constructor-arg name="secret" value="mySecret" /> > <property name="callbackUrl" > value="http://myweb.com:8080/social-callback" /> > </bean> > > But then I get the exact same error I've tried to get rid of (for the past > 2 hours...) in my own setup: > > org.springframework.beans.factory.BeanCreationException: Error creating bean > with name 'clients' defined in ServletContext resource > [/WEB-INF/spring/context-shiro.xml]: Initialization of bean failed; nested > exception is org.springframework.beans.ConversionNotSupportedException: > Failed to convert property value of type 'org.pac4j.core.client.Clients' to > required type 'org.pac4j.core.client.Client[]' for property 'clients'; nested > exception is java.lang.IllegalStateException: Cannot convert value of type > [org.pac4j.core.client.Clients] to required type > [org.pac4j.core.client.Client] for property 'clients[0]': no matching editors > or conversion strategy found > > > Is my Spring version (v4.0.3.RELEASE) more pickier then yours?! > Do I need to use another version of Pac4J (v1.5.1)? > Or is my buji-pac4j (v1.2.3) the reason? > > Personally I am tempted to look at Spring to blame, but then again I've > used similar Spring Bean definitions before... > I've tried variations with explicit 'index' or adding 'type' attributes > for the <constructor-arg> elements, even use <array> instead of <list> or > just reference the 'facebookClient' directly, ..., Spring stubbornly > continues to use this varargs ctor for some reason or another: > > public Clients(final String callbackUrl, final Client... clients) > > > Anyway, if you still have a (complete) working setup, please post/sent it! > > Regards, > > Frederik > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://shiro-user.582556.n2.nabble.com/pac4j-buji-spring-xml-support-tp7579628p7580078.html > To start a new topic under Shiro User, email > [email protected] > To unsubscribe from Shiro User, click here > <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=582556&code=bGVsZXVqQGdtYWlsLmNvbXw1ODI1NTZ8LTExNzY2MzcxMTY=> > . > NAML > <http://shiro-user.582556.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://shiro-user.582556.n2.nabble.com/pac4j-buji-spring-xml-support-tp7579628p7580079.html Sent from the Shiro User mailing list archive at Nabble.com.
