Re: [cas-user] Pac4j Retrieve attribute and passing to CAS client

2018-10-30 Thread Jérôme LELEU
Hi,

By nature, pac4j is written in Java language. In any case, data are passed
via the CAS assertion.
For simple types, things should be straightforward. For more complex types,
you many need some manual/custom adjustments.
Thanks.
Best regards,
Jérôme


On Mon, Oct 29, 2018 at 7:14 PM uvaraj s  wrote:

> 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  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 cas-user+u...@apereo.org.
>>> 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
>>> 
>>> .
>>>
>>
>> --
> - 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 cas-user+unsubscr...@apereo.org.
> 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
> 
> .
>

-- 
- 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 cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAP279LyBsdmbvFtGzDn99QUUvRUpw0Y2xqBaffuy5WJObXEQ9w%40mail.gmail.com.


Re: [cas-user] Pac4j Retrieve attribute and passing to CAS client

2018-10-29 Thread uvaraj s
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 > 
> 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 cas-user+u...@apereo.org .
>> 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
>>  
>> 
>> .
>>
>
>

-- 
- 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 cas-user+unsubscr...@apereo.org.
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.


Re: [cas-user] Pac4j Retrieve attribute and passing to CAS client

2018-03-16 Thread Jérôme LELEU
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  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 cas-user+unsubscr...@apereo.org.
> 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
> 
> .
>

-- 
- 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 cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAP279LyvfihQoR8JGaQbjZzbKqqVUKe%2BJFgNimTzvZCDmpVquQ%40mail.gmail.com.


[cas-user] Pac4j Retrieve attribute and passing to CAS client

2018-03-14 Thread uvaraj s
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 cas-user+unsubscr...@apereo.org.
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.