[cas-user] Re: Cas server - 5.2.5 and Rest Authentication support

2020-04-16 Thread dg
okey. i found the solution. 

in rest response, i provided "id" and "attributes". but when i add "@class" 
variable, it works.

@Data
private static class ResponseDTO {
@JsonProperty("@class")
private String clazz;
private String id;
private final Map attributes;
ResponseDTO(String id) {
this.id = id;
clazz = "org.apereo.cas.authentication.principal.SimplePrincipal";
attributes = new HashMap<>();
}
}

-- 
- 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/580d9bd0-fad1-4d6d-8f33-cd4dc2cdb60a%40apereo.org.


[cas-user] Re: Cas server - 5.2.5 and Rest Authentication support

2020-04-15 Thread dg
i return id and attributes from rest endpoint as response. 

my cas config

cas.authn.rest.uri=http://localhost:8082/validate
cas.authn.rest.name=restauth
cas.authn.rest.charset=UTF-8
cas.authn.rest.passwordEncoder.type=NONE


here is the log. "dg" value is returned from endpoint. so successful 
authentication at rest side. but error in cas side.


2020-04-15 18:57:46,630 ERROR 
[org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - 



2020-04-15 18:57:46,630 ERROR 
[org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <[restauth]: 
[Error while extracting response for type 

[class org.apereo.cas.authentication.principal.SimplePrincipal] and content 
type [application/json]; 

nested exception is 
org.springframework.http.converter.HttpMessageNotReadableException: JSON parse 
error: Missing type id when trying to resolve subtype of 

[simple type, class org.apereo.cas.authentication.principal.SimplePrincipal]: 
missing type id property '@class'; nested exception is 
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: 

Missing type id when trying to resolve subtype of [simple type, class 
org.apereo.cas.authentication.principal.SimplePrincipal]: missing type id 
property '@class'
 at [Source: (PushbackInputStream); line: 1, column: 27] / JSON parse error: 
Missing type id when trying to resolve subtype of [simple type, class 
org.apereo.cas.authentication.principal.SimplePrincipal]: 

missing type id property '@class'; nested exception is 
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when 
trying to resolve subtype of [simple type, class 
org.apereo.cas.authentication.principal.SimplePrincipal]: 

missing type id property '@class'
 at [Source: (PushbackInputStream); line: 1, column: 27]]>
2020-04-15 18:57:46,631 INFO 
[org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <[Static 
Credentials] exception details: [dg not found in backing map.].>


-- 
- 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/4a96cd3f-608d-4e74-9d14-df8e31a39fe2%40apereo.org.


[cas-user] Re: Cas server - 5.2.5 and Rest Authentication support

2020-04-15 Thread dg
hey, i got same issue. actually i dont understand solution. can you provide 
more information?

15 Haziran 2018 Cuma 20:33:54 UTC+3 tarihinde Raghavan TV yazdı:
>
> Hi,
>
> Am testing CAS against rest-authentication method. 
>
> But am always receiving an error in the log that says
> [1;31m2018-06-15 22:59:38,794 ERROR [org.apereo.cas.authentication.
> PolicyBasedAuthenticationManager] - <[restauth]: [JSON parse error: 
> Missing type id when trying to resolve subtype of [simple type, class org.
> apereo.cas.authentication.principal.SimplePrincipal]: missing type id 
> property '@class'; nested exception is com.fasterxml.jackson.databind.exc.
> InvalidTypeIdException: Missing type id when trying to resolve subtype of 
> [simple type, class org.apereo.cas.authentication.principal.
> SimplePrincipal]: missing type id property '@class'
>  at [Source: (PushbackInputStream); line: 1, column: 54] / Missing type 
> id when trying to resolve subtype of [simple type, class org.apereo.cas.
> authentication.principal.SimplePrincipal]: missing type id property 
> '@class'
>  at [Source: (PushbackInputStream); line: 1, column: 54]]> [m
> [1;31m2018-06-15 22:59:38,795 ERROR [org.apereo.cas.authentication.
> PolicyBasedAuthenticationManager] -  Credentials may be incorrect or CAS cannot find authentication handler 
> that supports [admin] of type [UsernamePasswordCredential]. Examine the 
> configuration to ensure a method of authentication is defined and analyze 
> CAS logs at DEBUG level to trace the authentication event.> [m
>
>
>
> Am I missing some configuration related to Policy ?
>
>
> Environment
> Windows 7
> JDK: 8
> Tomcat: 9.0.8
>
>
>
> 
> Steps followed
> 
> 1) Edited the pom.xml to add the rest-authentication overlay
> 
> org.apereo.cas
> cas-server-support-rest-authentication
> ${cas.version}
> 
> 2) Deployed a new REST (mock) service
>
> Note:
> Checked the logs and the request from CAS server is fine and the response 
> is also a HTTP-200 with following response
> {"@c":".SimplePrincipal","attributes":{},"id":"adminuser"}
>
>
> 3) Edited application.properties with following configured
>
> cas.authn.accept.users=
>> logging.level.org.apereo=TRACE
>> logging.level.org.jasig=TRACE
>> logging.level.org.apache=DEBUG
>>
>> cas.authn.rest.uri=http://localhost:9909/idp/authenticate
>> cas.authn.rest.name=restauth
>> cas.authn.rest.passwordEncoder.type=NONE
>>
>>
>
>

-- 
- 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/84b7a874-15af-4e65-b6e1-9c8b49e60ff2%40apereo.org.