Discussion:
How to get / know the service when implementing a custom authentication handler
Michael Wechner
2013-11-08 14:42:00 UTC
Permalink
Hi

I have implemented a custom authentication handler implementing

AbstractUsernamePasswordAuthenticationHandler#authenticateUsernamePasswordInternal(UsernamePasswordCredentials)

but the class UsernamePasswordCredentials

http://developer.jasig.org/projects/cas/cas-server-core/cas-server/cas-server-core/apidocs/org/jasig/cas/authentication/principal/UsernamePasswordCredentials.html

does not provide the service for which a user is authenticating (only
username and password).

I would like to submit the service also to the custom backend system
which we use for authentication.
Is there some alternative approach or some other way on how to get hold
of the service?

Thanks for your help

Michael
--
You are currently subscribed to cas-user-***@public.gmane.org as: gcjjcu-cas-Uylq5CNFT+***@public.gmane.org
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Alia Faton
2013-11-08 14:47:24 UTC
Permalink
Hello,

Since CAS uses spring web flow, you can use the following to get the service :

ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest req = sra.getRequest();
String service = req.getParameter("service");


-----Original Message-----
From: Michael Wechner [mailto:michael.wechner-***@public.gmane.org]
Sent: vendredi 8 novembre 2013 15:42
To: cas-user-***@public.gmane.org
Subject: [cas-user] How to get / know the service when implementing a custom authentication handler

Hi

I have implemented a custom authentication handler implementing

AbstractUsernamePasswordAuthenticationHandler#authenticateUsernamePasswordInternal(UsernamePasswordCredentials)

but the class UsernamePasswordCredentials

http://developer.jasig.org/projects/cas/cas-server-core/cas-server/cas-server-core/apidocs/org/jasig/cas/authentication/principal/UsernamePasswordCredentials.html

does not provide the service for which a user is authenticating (only username and password).

I would like to submit the service also to the custom backend system which we use for authentication.
Is there some alternative approach or some other way on how to get hold of the service?

Thanks for your help

Michael

--
You are currently subscribed to cas-user-***@public.gmane.org as: falia-***@public.gmane.orgsnet.be To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
--
You are currently subscribed to cas-user-***@public.gmane.org as: gcjjcu-cas-Uylq5CNFT+***@public.gmane.org
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Michael Wechner
2013-11-08 15:34:45 UTC
Permalink
Hi Alia

Thanks very much for this hint. This works very fine.

Thanks

Michael
Post by Alia Faton
Hello,
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest req = sra.getRequest();
String service = req.getParameter("service");
-----Original Message-----
Sent: vendredi 8 novembre 2013 15:42
Subject: [cas-user] How to get / know the service when implementing a custom authentication handler
Hi
I have implemented a custom authentication handler implementing
AbstractUsernamePasswordAuthenticationHandler#authenticateUsernamePasswordInternal(UsernamePasswordCredentials)
but the class UsernamePasswordCredentials
http://developer.jasig.org/projects/cas/cas-server-core/cas-server/cas-server-core/apidocs/org/jasig/cas/authentication/principal/UsernamePasswordCredentials.html
does not provide the service for which a user is authenticating (only username and password).
I would like to submit the service also to the custom backend system which we use for authentication.
Is there some alternative approach or some other way on how to get hold of the service?
Thanks for your help
Michael
--
--
You are currently subscribed to cas-user-***@public.gmane.org as: gcjjcu-cas-Uylq5CNFT+***@public.gmane.org
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
KaTeLmE
2013-11-08 22:11:14 UTC
Permalink
The right form of extract request arguments is through CAS argument
extractors because is the unique form to resolve it without be accoplated
to used protocol (CAS / SAML ....)

See
http://developer.jasig.org/projects/cas/cas-server-core/cas-server/cas-server-core/apidocs/org/jasig/cas/web/support/class-use/ArgumentExtractor.html
Post by Michael Wechner
Hi Alia
Thanks very much for this hint. This works very fine.
Thanks
Michael
Hello,
Post by Alia Faton
ServletRequestAttributes sra = (ServletRequestAttributes)
RequestContextHolder.getRequestAttributes();
HttpServletRequest req = sra.getRequest();
String service = req.getParameter("service");
-----Original Message-----
Sent: vendredi 8 novembre 2013 15:42
Subject: [cas-user] How to get / know the service when implementing a
custom authentication handler
Hi
I have implemented a custom authentication handler implementing
AbstractUsernamePasswordAuthenticationHandler#
authenticateUsernamePasswordInternal(UsernamePasswordCredentials)
but the class UsernamePasswordCredentials
http://developer.jasig.org/projects/cas/cas-server-core/
cas-server/cas-server-core/apidocs/org/jasig/cas/
authentication/principal/UsernamePasswordCredentials.html
does not provide the service for which a user is authenticating (only
username and password).
I would like to submit the service also to the custom backend system
which we use for authentication.
Is there some alternative approach or some other way on how to get hold of the service?
Thanks for your help
Michael
--
archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
--
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user
--
You are currently subscribed to cas-user-***@public.gmane.org as: gcjjcu-cas-Uylq5CNFT+***@public.gmane.org
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Michael Wechner
2013-11-09 07:19:29 UTC
Permalink
Post by KaTeLmE
The right form of extract request arguments is through CAS argument
extractors because is the unique form to resolve it without be
accoplated to used protocol (CAS / SAML ....)
See
http://developer.jasig.org/projects/cas/cas-server-core/cas-server/cas-server-core/apidocs/org/jasig/cas/web/support/class-use/ArgumentExtractor.html
thanks for this additional hint

Michael
Post by KaTeLmE
Hi Alia
Thanks very much for this hint. This works very fine.
Thanks
Michael
Hello,
Since CAS uses spring web flow, you can use the following to
ServletRequestAttributes sra =
(ServletRequestAttributes)
RequestContextHolder.getRequestAttributes();
HttpServletRequest req = sra.getRequest();
String service = req.getParameter("service");
-----Original Message-----
Sent: vendredi 8 novembre 2013 15:42
Subject: [cas-user] How to get / know the service when
implementing a custom authentication handler
Hi
I have implemented a custom authentication handler implementing
AbstractUsernamePasswordAuthenticationHandler#authenticateUsernamePasswordInternal(UsernamePasswordCredentials)
but the class UsernamePasswordCredentials
http://developer.jasig.org/projects/cas/cas-server-core/cas-server/cas-server-core/apidocs/org/jasig/cas/authentication/principal/UsernamePasswordCredentials.html
does not provide the service for which a user is
authenticating (only username and password).
I would like to submit the service also to the custom backend
system which we use for authentication.
Is there some alternative approach or some other way on how to
get hold of the service?
Thanks for your help
Michael
--
or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user
--
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user
--
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
--
You are currently subscribed to cas-user-***@public.gmane.org as: gcjjcu-cas-Uylq5CNFT+***@public.gmane.org
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Continue reading on narkive:
Search results for 'How to get / know the service when implementing a custom authentication handler' (Questions and Answers)
5
replies
can i get question answer of asp.net ?
started 2006-10-11 00:02:47 UTC
software
3
replies
Required Java syllabus?
started 2007-07-25 22:08:10 UTC
programming & design
Loading...