Hi Jerome,
Thanks a lot. I was able to retrieve the attributes in JAVA as given below.
We have CAS client which is developed in Python. How do I get that
CasProfile in Python?. Do pac4j support Python?. When we try Django-cas-ng
it is giving AnonymousUser.
public CasProfile validateServiceTicket(final String serviceURL, final
TokenCredentials ticket) {
try {
final Assertion assertion =
getCasRestAuthenticator().getTicketValidator()
.validate(ticket.getToken(), serviceURL);
final AttributePrincipal principal = assertion.getPrincipal();
final CasProfile casProfile = new CasProfile();
casProfile.setId(principal.getName());
casProfile.addAttributes(principal.getAttributes());
return casProfile;
} catch (final TicketValidationException e) {
throw new TechnicalException(e);
}
}
public CasRestAuthenticator getCasRestAuthenticator() {
Authenticator authenticator = getAuthenticator();
if (authenticator instanceof LocalCachingAuthenticator) {
authenticator = ((LocalCachingAuthenticator)
authenticator).getDelegate();
}
if (authenticator instanceof CasRestAuthenticator) {
return (CasRestAuthenticator) authenticator;
}
throw new TechnicalException("authenticator must be a
CasRestAuthenticator (or via a LocalCachingAuthenticator)");
}
On Friday, 16 March 2018 11:34:51 UTC-4, leleuj wrote:
>
> Hi,
>
> This documentation should help you:
> https://apereo.github.io/cas/4.2.x/integration/Delegate-Authentication.html#how-to-use-this-support-on-cas-applications-side
> Thanks.
> Best regards,
> Jérôme
>
>
> On Thu, Mar 15, 2018 at 3:31 AM, uvaraj s <[email protected] <javascript:>>
> wrote:
>
>> Hi,
>>
>> We are using CAS 4.1.2 and pac4j 1.7 version. We are making SAML2Client
>> call to shibboleth. These question might look like very basic ones. But the
>> answer to these will help us a lot.
>>
>> 1.On the logs, I am able to see the attribute details getting printed.
>> But wanted to know how we can able to retrieve user profile details in the
>> code?.
>> 2.How does client application who uses this CAS server will be able to
>> get these attribute details?
>>
>> Thanks a lot in Advance.
>>
>> --
>> - 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/7aee0ca9-4edd-48af-848f-c9cc7206cd58%40apereo.org
>>
>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/7aee0ca9-4edd-48af-848f-c9cc7206cd58%40apereo.org?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/02f98c1d-8cd4-42b6-b028-15b276865cb0%40apereo.org.