> Not sure if RestAPI also uses this login-webflow.xml or if any other
configuration is needed ?

 

It always assumes UsernamePasswordCredential. You'll have to extend CAS to
provide the type you want. 

 

 

From: Jayakumar Jayaraman [mailto:[email protected]] 
Sent: Thursday, May 21, 2015 6:39 AM
To: [email protected]
Subject: [cas-user] CAS 4 - Rest API - custom credential type not working
....

 

Hi Guys

 

I have a working CAS applications.  I am now trying to use its RestAPI.

 

But having trouble while calling /cas/v1/tickets

 

Our application has 2 factor authentication and hence have three fields
(username, password, otp) in the login page.

 

When it gets into the below DummyOTPAuthenticationHandler, the credential
is always a instanceof UsernamePasswordCredential

But I am expecting it to be the instance of our
OTPUsernamePasswordCredential as in our web application...

In our web application we have configured this in the login-webflow.xml

<var name="credential"
class="com.myapp.cas.authentication.OTPUsernamePasswordCredential" />

 

Not sure if RestAPI also uses this login-webflow.xml or if any other
configuration is needed ?

 

Code:-

 

public class DummyOTPAuthenticationHandler extends
AbstractUsernamePasswordAuthenticationHandler { /** Spring injected dummy
OTP */ private String dummyOTP; @Override protected HandlerResult
authenticateUsernamePasswordInternal(UsernamePasswordCredential
credential) throws GeneralSecurityException, PreventedException {
OTPUsernamePasswordCredential otpCredential = null; if (credential
instanceof OTPUsernamePasswordCredential) {

..............

 

 

Thanks

Jay

 

 
-- 
You are currently subscribed to [email protected]
<mailto:[email protected]>  as: [email protected]
<mailto:[email protected]> 
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to