Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AuthenticationDate parse error #19

Open
helphi opened this issue Jun 21, 2018 · 5 comments
Open

AuthenticationDate parse error #19

helphi opened this issue Jun 21, 2018 · 5 comments

Comments

@helphi
Copy link

helphi commented Jun 21, 2018

CAS3.0 server return AuthenticationDate with ZonedDateTime src, but go-cas parse it with time.Time, so i get the error bellow:

parsing time "2018-06-21T14:44:52.715+08:00[Asia/Shanghai]": extra text: [Asia/Shanghai]

the response is:

curl "http://cas.example.com/p3/serviceValidate?service=http://localhost:9000&ticket=ST-2344-9oiwc7g9_xg5HBxx3T371X4ARLI-db796d3ad01b"

<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'>
    <cas:authenticationSuccess>
        <cas:user>helphi</cas:user>
        <cas:attributes>
            <cas:credentialType>RememberMeUsernamePasswordCredential</cas:credentialType>
            <cas:isFromNewLogin>true</cas:isFromNewLogin>
            <cas:mail>helphi@example.com</cas:mail>
            <cas:authenticationDate>2018-06-21T13:43:07.597+08:00[Asia/Shanghai]</cas:authenticationDate>
            <cas:authenticationMethod>LdapAuthenticationHandler</cas:authenticationMethod>
            <cas:successfulAuthenticationHandlers>LdapAuthenticationHandler</cas:successfulAuthenticationHandlers>
            <cas:longTermAuthenticationRequestTokenUsed>true</cas:longTermAuthenticationRequestTokenUsed>
            <cas:sn>helphi.he</cas:sn>
            </cas:attributes>
    </cas:authenticationSuccess>
</cas:serviceResponse>
@geoffgarside
Copy link
Contributor

Based on the CAS 3.0 spec that form of cas:authenticationDate isn't valid for the XML Schema xs:dateTime type.

@helphi
Copy link
Author

helphi commented Aug 6, 2018

Based on the CAS 3.0 spec, cas server use ZonedDateTime to process xs:dateTime and go-cas use time.Time to process xs:dateTime, but ZonedDateTime of java is not compatible with time.Time of golang.

@geoffgarside
Copy link
Contributor

It doesn't look like ZonedDateTime is compatible with xs:dateTime, so while it may be able to parse it in Java it doesn't look like the generation of the authenticationDate in the apero CAS server is valid according to the specification.

@helphi
Copy link
Author

helphi commented Aug 6, 2018

But CAS server and the cas-java-client implements xs:dateTime with ZonedDateTime now, and we can't parse it with go-cas.

@l1905
Copy link

l1905 commented Aug 31, 2020

my result is same, it need to compatible, or cas 3.0 will not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants