Attribute Query --- JDBC

51 views
Skip to first unread message

mynharry

unread,
May 18, 2018, 6:22:03 PM5/18/18
to CAS Community
Hi List.

New to CAS and installing CAS5.2.4 to kick the tires.

Hit a snag w.r.t attribute resolution -- I have read and re-read the documentation -- probably there is so much new stuff for me, that it is not sinking in.

Questions?

-- If I wish to have JDBC lookup on attributes --- upon user authentication -- I require the following in the 'cas.properties'?
-- how do I handle custom attributes -- we happen to have a few unique ones only in our institutions --- do I map them like 'cas.authn.attributeRepository.jdbc[0].attributes.eduIdentifier=NETID'? Withe NETID retrieve from SQL query listed below?
-- How does the CAS-Management know which attributes are being leveraged by my CAS installation?

Thank you.


cas.authn.attributeRepository.jdbc[0].attributes.eduUsername=LOGIN_NAME
cas.authn.attributeRepository.jdbc[0].attributes.studentNumber=STUDENT_NUMBER
cas.authn.attributeRepository.jdbc[0].attributes.employeeNumber=EMPLOYEE_NUMBER
cas.authn.attributeRepository.jdbc[0].attributes.eduAffiliation=EDU_AFFILIATION
cas.authn.attributeRepository.jdbc[0].attributes.givenName=FIRST_NAME
cas.authn.attributeRepository.jdbc[0].attributes.sn=LAST_NAME
cas.authn.attributeRepository.jdbc[0].attributes.displayName=LOGIN_PREFERRED_NAME
cas.authn.attributeRepository.jdbc[0].attributes.eduIdentifier=NETID
cas.authn.attributeRepository.jdbc[0].attributes.mail=EMAIL

cas.authn.attributeRepository.jdbc[0].singleRow=true
cas.authn.attributeRepository.jdbc[0].order=0
cas.authn.attributeRepository.jdbc[0].requireAllAttributes=true
cas.authn.attributeRepository.jdbc[0].caseCanonicalization=NONE
cas.authn.attributeRepository.jdbc[0].queryType=OR|AND

# Used only when there is a mapping of many rows to one user
# cas.authn.attributeRepository.jdbc[0].columnMappings.columnAttrName1=columnAttrValue1
# cas.authn.attributeRepository.jdbc[0].columnMappings.columnAttrName2=columnAttrValue2
# cas.authn.attributeRepository.jdbc[0].columnMappings.columnAttrName3=columnAttrValue3

cas.authn.attributeRepository.jdbc[0].sql=SELECT LOGIN_NAME,STUDENT_NUMBER,EMPLOYEE_NUMBER, EDU_AFFILIATION,FIRST_NAME,LAST_NAME,LOGIN_PREFERRED_NAME,NETID, EMAIL FROM NET.LOGIN_VW where {0}
cas.authn.attributeRepository.jdbc[0].username=uid
cas.authn.attributeRepository.jdbc[0].healthQuery=SELECT 1 FROM DUAL
cas.authn.attributeRepository.jdbc[0].isolateInternalQueries=false
cas.authn.attributeRepository.jdbc[0].url=SNIP
cas.authn.attributeRepository.jdbc[0].failFastTimeout=1
cas.authn.attributeRepository.jdbc[0].isolationLevelName=ISOLATION_READ_COMMITTED
cas.authn.attributeRepository.jdbc[0].dialect=org.hibernate.dialect.Oracle12cDialect
cas.authn.attributeRepository.jdbc[0].leakThreshold=10
cas.authn.attributeRepository.jdbc[0].propagationBehaviorName=PROPAGATION_REQUIRED
cas.authn.attributeRepository.jdbc[0].batchSize=1
cas.authn.attributeRepository.jdbc[0].user=SNIP
cas.authn.attributeRepository.jdbc[0].ddlAuto=update
cas.authn.attributeRepository.jdbc[0].password=SNIP
cas.authn.attributeRepository.jdbc[0].autocommit=false
cas.authn.attributeRepository.jdbc[0].driverClass=oracle.jdbc.OracleDriver
cas.authn.attributeRepository.jdbc[0].idleTimeout=5000
cas.authn.attributeRepository.jdbc[0].pool.suspension=false
cas.authn.attributeRepository.jdbc[0].pool.minSize=6
cas.authn.attributeRepository.jdbc[0].pool.maxSize=18
cas.authn.attributeRepository.jdbc[0].pool.maxWait=2000
#cas.authn.attributeRepository.jdbc[0].dataSourceName=
cas.authn.attributeRepository.jdbc[0].dataSourceProxy=false

# Hibernate-specific properties (i.e. `hibernate.globally_quoted_identifiers`)
# cas.authn.attributeRepository.jdbc[0].properties.propertyName=propertyValue

mynharry

unread,
May 19, 2018, 1:30:36 PM5/19/18
to CAS Community
Found the root cause, the thin JDBC URL to my database was incorrectly formatted (not shown below for privacy).

For others reading this post to use as a reference: the settings are otherwise correct below (also corrected for a '|'):


cas.authn.attributeRepository.jdbc[0].attributes.eduUsername=LOGIN_NAME
cas.authn.attributeRepository.jdbc[0].attributes.studentNumber=STUDENT_NUMBER
cas.authn.attributeRepository.jdbc[0].attributes.employeeNumber=EMPLOYEE_NUMBER
cas.authn.attributeRepository.jdbc[0].attributes.eduAffiliation=EDU_AFFILIATION
cas.authn.attributeRepository.jdbc[0].attributes.givenName=FIRST_NAME
cas.authn.attributeRepository.jdbc[0].attributes.sn=LAST_NAME
cas.authn.attributeRepository.jdbc[0].attributes.displayName=LOGIN_PREFERRED_NAME
cas.authn.attributeRepository.jdbc[0].attributes.eduIdentifier=NETID
cas.authn.attributeRepository.jdbc[0].attributes.mail=EMAIL

cas.authn.attributeRepository.jdbc[0].singleRow=true
cas.authn.attributeRepository.jdbc[0].order=0
cas.authn.attributeRepository.jdbc[0].requireAllAttributes=true
cas.authn.attributeRepository.jdbc[0].caseCanonicalization=NONE
cas.authn.attributeRepository.jdbc[0].queryType=OR

On Friday, May 18, 2018 at 3:22:03 PM UTC-7, mynharry wrote:
Hi List.

New to CAS and installing CAS5.2.4 to kick the tires.

Hit a snag w.r.t attribute resolution -- I have read and re-read the documentation -- probably there is so much new stuff for me, that it is not sinking in.

Questions?

-- If I wish to have JDBC lookup on attributes --- upon user authentication -- I require the following in the 'cas.properties'?
-- how do I handle custom attributes -- we happen to have a few unique ones only in our institutions --- do I map them like 'cas.authn.attributeRepository.jdbc[0].attributes.eduIdentifier=NETID'? Withe NETID retrieve from SQL query listed below?
-- How does the CAS-Management know which attributes are being leveraged by my CAS installation?

Thank you.


cas.authn.attributeRepository.jdbc[0].attributes.eduUsername=LOGIN_NAME
cas.authn.attributeRepository.jdbc[0].attributes.studentNumber=STUDENT_NUMBER
cas.authn.attributeRepository.jdbc[0].attributes.employeeNumber=EMPLOYEE_NUMBER
cas.authn.attributeRepository.jdbc[0].attributes.eduAffiliation=EDU_AFFILIATION
cas.authn.attributeRepository.jdbc[0].attributes.givenName=FIRST_NAME
cas.authn.attributeRepository.jdbc[0].attributes.sn=LAST_NAME
cas.authn.attributeRepository.jdbc[0].attributes.displayName=LOGIN_PREFERRED_NAME
cas.authn.attributeRepository.jdbc[0].attributes.eduIdentifier=NETID
cas.authn.attributeRepository.jdbc[0].attributes.mail=EMAIL

cas.authn.attributeRepository.jdbc[0].singleRow=true
cas.authn.attributeRepository.jdbc[0].order=0
cas.authn.attributeRepository.jdbc[0].requireAllAttributes=true
cas.authn.attributeRepository.jdbc[0].caseCanonicalization=NONE
cas.authn.attributeRepository.jdbc[0].queryType=OR

Reply all
Reply to author
Forward
0 new messages