U need include library encode password (md5, sha, custome,...) 2017-02-28 8:48 GMT+07:00 Tuan Nguyen <[email protected]>:
> Hello, I am using CAS Server version 5.0.2. How can I define an > authentication handler with a custom password encoder? I can define one in > the application.properties file like this: > > # cas.authn.jdbc.encode[0].numberOfIterations=0 > # cas.authn.jdbc.encode[0].numberOfIterationsFieldName=numIterations > # cas.authn.jdbc.encode[0].saltFieldName=salt > # cas.authn.jdbc.encode[0].staticSalt= > # cas.authn.jdbc.encode[0].sql= > # cas.authn.jdbc.encode[0].algorithmName= > # cas.authn.jdbc.encode[0].passwordFieldName=password > # cas.authn.jdbc.encode[0].healthQuery=SELECT 1 FROM > INFORMATION_SCHEMA.SYSTEM_USERS > # cas.authn.jdbc.encode[0].isolateInternalQueries=false > # cas.authn.jdbc.encode[0].url=jdbc:hsqldb:mem:cas-hsql-database > # cas.authn.jdbc.encode[0].failFast=true > # cas.authn.jdbc.encode[0].isolationLevelName=ISOLATION_READ_COMMITTED > # cas.authn.jdbc.encode[0].dialect=org.hibernate.dialect.HSQLDialect > # cas.authn.jdbc.encode[0].leakThreshold=10 > # cas.authn.jdbc.encode[0].propagationBehaviorName=PROPAGATION_REQUIRED > # cas.authn.jdbc.encode[0].batchSize=1 > # cas.authn.jdbc.encode[0].user=sa > # cas.authn.jdbc.encode[0].ddlAuto=create-drop > # cas.authn.jdbc.encode[0].maxAgeDays=180 > # cas.authn.jdbc.encode[0].password= > # cas.authn.jdbc.encode[0].autocommit=false > # cas.authn.jdbc.encode[0].driverClass=org.hsqldb.jdbcDriver > # cas.authn.jdbc.encode[0].idleTimeout=5000 > # cas.authn.jdbc.encode[0].credentialCriteria= > > # cas.authn.jdbc.encode[0].passwordEncoder.type=NONE|DEFAULT|STANDARD|BCRYPT > # cas.authn.jdbc.encode[0].passwordEncoder.characterEncoding= > # cas.authn.jdbc.encode[0].passwordEncoder.encodingAlgorithm= > # cas.authn.jdbc.encode[0].passwordEncoder.secret= > # cas.authn.jdbc.encode[0].passwordEncoder.strength=16 > > > However, it is not possible to define a custom password encoder. > > I declared 2 beans in the deployerConfigContext.xml (in /WEB-INF folder) > but they were not picked up by the CAS server > > <bean id = "authenticationManager" class = > "org.apereo.cas.authentication.PolicyBasedAuthenticationManager"> > <constructor-arg> > <list> > <bean id="dbAuthHandler" > class="org.apereo.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler"> > <property name="dataSource" ref="dataSource"/> > <property name="sql" value="select password from users where > lower(username) = lower(?)"/> > > </bean> > </list> > </constructor-arg> > </bean> > > <!-- MySQL connector --> > <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> > <property name="driverClassName" value="com.mysql.jdbc.Driver"/> > <property name="url" value="jdbc:mysql://localhost:3306/cas"/> > <property name="username" value="root"/> > <property name="password" value="password"/> > </bean> > > > Any ideas? > > -- > - 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 [email protected]. > To view this discussion on the web visit https://groups.google.com/a/ > apereo.org/d/msgid/cas-user/edb0ab8a-7c71-4664-8f80- > cb15058610a9%40apereo.org > <https://groups.google.com/a/apereo.org/d/msgid/cas-user/edb0ab8a-7c71-4664-8f80-cb15058610a9%40apereo.org?utm_medium=email&utm_source=footer> > . > -- *FullName :* *Vũ Anh Tuấn* *Workplace:* *P.Tư vấn và Triển khai - Trung Tâm Chuyển giao công nghệ - Cục Công nghệ thông tin - Bộ TN&MT.* *HandFone:* *090.349.4078* *Email :* *[email protected] <[email protected]> - [email protected] <[email protected]>* *Skype :* *vuanhtuanbk248* -- - 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 [email protected]. To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAJWGQY7D%3DjyyZc1o4GoCQUe6-cS7mHf2GYS8iYWPPvmbNMQufw%40mail.gmail.com.
