It seems like you are missing how to extract attributes.

You can see how this is done here:
https://apereo.github.io/2018/02/20/cas-service-rbac-attributeresolution/


then i guess that you should define an attribute release policy as 
described here:
https://apereo.github.io/cas/6.0.x/integration/Attribute-Release-Policies.html

hope it helps
Michele

On Sunday, January 20, 2019 at 7:37:34 PM UTC+1, john adz wrote:
>
> I added what you said in the file, but I got an error. The file contents 
> and the output of cas.log are as follows.
>
> application.properties
>
> cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
>
>
> cas.authn.jdbc.query[0].passwordEncoder.type=DEFAULT
>
>
> cas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8
>
>
> cas.authn.jdbc.query[0].passwordEncoder.encodingAlgorithm=SHA-256
>
>
> cas.authn.jdbc.query[0].passwordEncoder.secret=
>
>
> cas.authn.jdbc.query[0].passwordEncoder.strength=16
>
>
> #cas.authn.jdbc.query[0].principalAttributeList=email,mail
>
>
>
> cas.authn.attributeRepository.jdbc[0].attributes.mail=mail
>
>
>
>
>
>
> cas.log
>
> WARN 
> [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext]
>  
> - <Exception encountered during context initialization - cancelling refresh 
> attempt: org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 
> 'com.ryantenney.metrics.spring.MetricsBeanPostProcessorFactory#4': Cannot 
> resolve reference to bean 'metrics' while setting constructor argument; 
> nested exception is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
> creating bean with name 'casMetricsConfiguration': Unsatisfied dependency 
> expressed through field 'handlerMapping'; nested exception is 
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
> creating bean with name 'casWebAppConfiguration': Unsatisfied dependency 
> expressed through field 'casProperties'; nested exception is 
> org.springframework.beans.factory.BeanCreationException: Error creating 
> bean with name 
> 'cas-org.apereo.cas.configuration.CasConfigurationProperties': Could not 
> bind properties to CasConfigurationProperties (prefix=cas, 
> ignoreInvalidFields=false, ignoreUnknownFields=true, 
> ignoreNestedProperties=false); nested exception is 
> org.springframework.beans.InvalidPropertyException: Invalid property 
> 'authn.attributeRepository.jdbc[0][attributes][mail]' of bean class 
> [org.apereo.cas.configuration.model.core.authentication.AuthenticationProperties]:
>  
> Illegal attempt to get property 'jdbc' threw exception; nested exception is 
> org.springframework.beans.InvalidPropertyException: Invalid property 
> 'authn.attributeRepository.jdbc[0][attributes][mail]' of bean class 
> [org.apereo.cas.configuration.model.core.authentication.AuthenticationProperties]:
>  
> Property referenced in indexed property path 'jdbc[0][attributes][mail]' is 
> neither an array nor a List nor a Set nor a Map; returned value was 
> [org.apereo.cas.configuration.model.core.authentication.PrincipalAttributesProperties$Jdbc@17869b28]>
>
> On Fri, Jan 18, 2019 at 10:59 PM Ray Bon <[email protected] <javascript:>> 
> wrote:
>
>> John,
>>
>> From this part of the docs, 
>> https://apereo.github.io/cas/5.2.x/installation/Configuration-Properties.html#jdbc-1,
>>  
>> you may need cas.authn.attributeRepository.jdbc[0].attributes.mail=mail
>>
>> Ray
>>
>> On Fri, 2019-01-18 at 21:55 +0300, john adz wrote:
>>
>> Hi, 
>>
>> Hello, I want to send other information such as mail address or firstname 
>> which is registered in user database. What should I add to 
>> application.properties? Can you give an example?
>>
>> On Fri, Jan 18, 2019 at 8:07 PM Ray Bon <[email protected] <javascript:>> 
>> wrote:
>>
>> John,
>>
>> Do you mean you want to email the user the service they logged in to? Or 
>> send the service the user's email address?
>> If the latter, you have to release the attribute in the service 
>> definition, 
>> https://apereo.github.io/cas/5.2.x/integration/Attribute-Release-Policies.html
>>
>> To see what attributes are being released, use this logging:
>>
>>         <!-- DEBUG Found principal attributes [...] for [username]
>>                    Attribute policy [???] allows release of [...] for 
>> [username]
>>                    Final collection of attributes allowed are: [...] -->
>>         <AsyncLogger 
>> name="org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy"
>>  
>> level="debug"/>
>>
>> Ray
>>
>> On Fri, 2019-01-18 at 04:16 -0800, john adz wrote:
>>
>> Hi,
>> I did cas mysql authentication. I want to send cas service to the user's 
>> email address. Add attribute, but not. Can you help me?
>>
>> application.properties
>>
>> cas.authn.accept.users=
>>
>>
>> cas.authn.jdbc.query[0].fieldUser=username
>>
>>
>> cas.authn.jdbc.query[0].sql=SELECT password FROM users WHERE username=?
>>
>>
>> cas.authn.jdbc.query[0].healthQuery=SELECT 1 FROM db.users
>>
>>
>> cas.authn.jdbc.query[0].tableUsers=users
>>
>>
>> cas.authn.jdbc.query[0].fieldPassword=password
>>
>>
>> cas.authn.jdbc.query[0].url=jdbc:mysql://localhost:3306/db
>>
>>
>> cas.authn.jdbc.query[0].user=root
>>
>>
>> cas.authn.jdbc.query[0].password=***
>>
>>
>> cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
>>
>>
>> cas.authn.jdbc.query[0].passwordEncoder.type=DEFAULT
>>
>>
>> cas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8
>>
>>
>> cas.authn.jdbc.query[0].passwordEncoder.encodingAlgorithm=SHA-256
>>
>>
>> cas.authn.jdbc.query[0].passwordEncoder.secret=
>>
>>
>> cas.authn.jdbc.query[0].passwordEncoder.strength=16
>>
>>
>> cas.authn.jdbc.query[0].principalAttributeList=email,mail
>>
>>
>>
>> cas.authn.attributeRepository.jdbc.sql=SELECT * FROM users WHERE {0}
>>
>> cas.authn.attributeRepository.jdbc.username=username
>>
>> cas.authn.attributeRepository.jdbc.healthQuery=
>>
>> cas.authn.attributeRepository.jdbc.url=jdbc:mysql://localhost:3306/db
>>
>> cas.authn.attributeRepository.jdbc.singleRow=true
>>
>> cas.authn.attributeRepository.jdbc.user=root
>>
>> cas.authn.attributeRepository.jdbc.password=***
>>
>> cas.authn.attributeRepository.attributes.email=email
>>
>> cas.authn.attributeRepository.attributes.mail=mail
>>
>> -- 
>> Ray Bon
>> Programmer analyst
>> Development Services, University Systems
>> 2507218831 | CLE 019 | [email protected] <javascript:>
>>
>> -- 
>> - Website: https://apereo.github.io/cas
>> - Gitter Chatroom: https://gitter.im/apereo/cas
>> - List Guidelines: https://goo.gl/1VRrw7
>> - Contributions: https://goo.gl/mh7qDG
>> --- 
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/a/apereo.org/d/msgid/cas-user/1547831249.3078.147.camel%40uvic.ca
>>  
>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/1547831249.3078.147.camel%40uvic.ca?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> Ray Bon
>> Programmer analyst
>> Development Services, University Systems
>> 2507218831 | CLE 019 | [email protected] <javascript:>
>>
>> -- 
>> - Website: https://apereo.github.io/cas
>> - Gitter Chatroom: https://gitter.im/apereo/cas
>> - List Guidelines: https://goo.gl/1VRrw7
>> - Contributions: https://goo.gl/mh7qDG
>> --- 
>> 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 [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/a/apereo.org/d/msgid/cas-user/1547841558.3078.169.camel%40uvic.ca
>>  
>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/1547841558.3078.169.camel%40uvic.ca?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/3663f6da-1b0f-4953-a728-2dc81ee02113%40apereo.org.

Reply via email to