I think you should implement directly an AuthenticationProvider and place 
your custom code which validates the jwt ticket in the authenticate() 
method.

When using the Jwt as service ticket I guess there is no need to use any of 
CasAuthenticationProvider facilities, since you are not supposed to contact 
cas any longer ( 
https://apereo.github.io/cas/6.0.x/installation/Configure-ServiceTicket-JWT.html
 
)

Hope it helps
Michele

On Tuesday, January 15, 2019 at 4:12:24 PM UTC+1, Xavier Rodríguez wrote:
>
> Hi,
>
> My question is if in this line:
>
>        CasAuthenticationProvider provider = new 
> CasAuthenticationProvider();
>
> I have to modify the "CasAuthenticationProvider" to another similar: 
> "JWTAuthenticationProvider"
>  
>        JWTAuthenticationProvider provider = new 
> JWTAuthenticationProvider(..)
>
> And I have to implement in this JWTAuthenticationProvider the  
> authenticate() method that only validate the "tiket" passed inthe request?
>
> Thanks,
>
> - Xavier -
>
> El dilluns, 14 gener de 2019 16:23:13 UTC+1, Michele Melluso va escriure:
>>
>> Hi,
>>
>> we did it with java-jwt library. Taking inspiration from the readme, hope 
>> it helps:
>>
>> https://github.com/auth0/java-jwt
>>
>> regards
>> Michele
>>
>> On Monday, January 14, 2019 at 4:09:57 PM UTC+1, Xavier Rodríguez wrote:
>>>
>>> I've configured CAS-Server to return JWT and it works fine. My problem 
>>> is that I don't know how configure correctly my client to read this token. 
>>> My client is configured with spring-security-cas package. In a 
>>> "traditional authentication" CAS I define something similar as:
>>>
>>> public CasAuthenticationProvider casAuthenticationProvider() {
>>>         CasAuthenticationProvider provider = new 
>>> CasAuthenticationProvider();
>>>         provider.setServiceProperties(serviceProperties());
>>>         provider.setTicketValidator(ticketValidator());
>>>         ...
>>>         provider.setUserDetailsService(
>>>                 s -> new User(...)
>>>         ...
>>>         return provider;
>>>     }
>>>
>>> In JWT case, I've to define an implementation similar to 
>>> CasAuthenticationProvider that it reads the ticket 
>>> (&ticket=eyJhbGciOiJIUzUxMiJ9.ZX...) received from de the cas? Any idea to 
>>> do this?
>>>
>>> Regards!
>>>
>>

-- 
- 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/894c9afd-0dbd-42bc-a96a-f5076d1b1045%40apereo.org.

Reply via email to