Hi,
I am trying to setup CAS 5.1 and I have enabled Facebook login successfully.
But I cannot retrieve Facebook Fields and server log see empty attribute list in principal.
Please kindly advise if there is some setting missing. Thanks!
Regards,
Raymond Cheng
[service json]
_hkscs{
"@class": "org.apereo.cas.services.RegexRegisteredService",
"id": 10000001,
"name": "sample",
"serviceId": "^(http|https)://.*\\.testing\\.com/.*",
"evaluationOrder": 1,
"attributeReleasePolicy" : {
"@class" : "org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy",
"allowedAttributes" : [ "java.util.ArrayList", [ "id", "name", "first_name", "middle_name", "last_name", "email" ] ]
}
}
[cas.properties]
cas.authn.pac4j.name=facebook login
cas.authn.pac4j.typedIdUsed=true
cas.authn.pac4j.autoRedirect=false
cas.authn.pac4j.facebook.id=123
cas.authn.pac4j.facebook.secret=123
cas.authn.pac4j.facebook.scope=public_profile,email
cas.authn.pac4j.facebook.fields=id,name,first_name,middle_name,last_name,email
[cas log on startup]
2017-06-22 15:04:15,645 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Final list of attribute repositories is [[]]>
2017-06-22 15:04:15,656 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured merging strategy for attribute sources is [REPLACE]>
2017-06-22 15:04:15,666 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <No attribute repository sources are available/defined to merge together.>
[cas log after facebook login]
2017-06-22 14:34:45,167 DEBUG [org.apereo.cas.authentication.principal.cache.AbstractPrincipalAttributesRepository] - <Could not find principal [org.pac4j.oauth.profile.facebook.FacebookProfile#112233406054479] in the repository so no attributes are returned.>
2017-06-22 14:34:45,168 DEBUG [org.apereo.cas.authentication.principal.cache.AbstractPrincipalAttributesRepository] - <Found [0] attributes for principal [org.pac4j.oauth.profile.facebook.FacebookProfile#112233406054479] from the attribute repository.>
2017-06-22 14:34:45,169 DEBUG [org.apereo.cas.authentication.principal.cache.AbstractPrincipalAttributesRepository] - <No merging strategy found, so attributes retrieved from the repository will be used instead.>
2017-06-22 14:34:45,171 DEBUG [org.apereo.cas.authentication.principal.DefaultPrincipalAttributesRepository] - <Using [org.pac4j.oauth.profile.facebook.FacebookProfile#112233406054479], no caching takes place for [DefaultPrincipalAttributesRepository] to add attributes.>
2017-06-22 14:34:45,172 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Found principal attributes [{}] for [org.pac4j.oauth.profile.facebook.FacebookProfile#112233406054479]>
2017-06-22 14:34:45,173 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Calling attribute policy [ReturnAllowedAttributeReleasePolicy] to process attributes for [org.pac4j.oauth.profile.facebook.FacebookProfile#112233406054479]>
2017-06-22 14:34:45,173 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Attribute policy [ReturnAllowedAttributeReleasePolicy] allows release of [{}] for [org.pac4j.oauth.profile.facebook.FacebookProfile#112233406054479]>
2017-06-22 14:34:45,174 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Attempting to merge policy attributes and default attributes>
2017-06-22 14:34:45,174 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Checking default attribute policy attributes>
2017-06-22 14:34:45,175 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Located application context. Retrieving default attributes for release, if any>
2017-06-22 14:34:45,175 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Default attributes for release are: [[cn, givenName, uid, affiliation]]>
2017-06-22 14:34:45,176 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Default attributes found to be released are [{}]>
2017-06-22 14:34:45,176 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Adding default attributes first to the released set of attributes>
2017-06-22 14:34:45,177 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Adding policy attributes to the released set of attributes>
2017-06-22 14:34:45,177 DEBUG [org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy] - <Final collection of attributes allowed are: [{}]>
2017-06-22 14:34:45,178 DEBUG [org.apereo.cas.services.DefaultRegisteredServiceUsernameProvider] - <Returning the default principal id [org.pac4j.oauth.profile.facebook.FacebookProfile#112233406054479] for username.>
Same issue with a 5.1.0 server and authentication delegated to Google...
--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/a0ffb08b-ead2-46bc-946d-566414cae4b7%40apereo.org.
Hi Steve,
Thanks for your email.
Here is the link for my knowledge.
https://apereo.github.io/cas/5.2.x/integration/Delegate-Authentication.html#delegated-authentication
https://apereo.github.io/cas/5.2.x/installation/Configuration-Properties.html#pac4j-delegated-authn
Besides, the latest CAS version work fine and I can use Facebook login now.
I am using Spring Security for integration. I need to use new ticket validator “org.jasig.cas.client.validation.Cas30ServiceTicketValidator” to retrieve Facebook attribute after login success.
Hope you can find useful information.
Raymond
From: Steve Hespelt [mailto:shes...@gmail.com]
Sent: Wednesday, April 04, 2018 1:47 AM
To: CAS Community
Cc: Raymond Cheng - ITD
Subject: Re: [cas-user] CAS 5.1 Question to retrieve Facebook Profile Fields
Hi Raymond,
I came across your post & I have a really (?) simple question: where did you find documentation on what values should be used for various authn properties - eg. the cas.authn.pac4j.facebook.scope=public_profile,email that you had in the 6/22/17 post? I've been looking at the CAS 5.2.x docs & one thing I've noticed is a lack of detail on what values are meaningful for various properties & the implications for using such values. grepping the src tree for fully specified property names or just prefixes (eg. "cas.authn.pac4j." result in matches found only in the /docs/.... So obviously the code doesn't use full property name strings to retrieve values.
Hope you can just point me in the right direction.
And I'm curious if you find the solution to your post.
Thanks,
-steve