1) Is there any documentation for the /oauth2.0/callbackAuthorize endpoint?
Yes. See this link for general design notes, and then take a look at how pac4j works.
2) Why is the CAS server issueing a ticket in an OAuth2 flow? Should he not produce an access token instead?
No. Authorization code flows issue ATs via the access token endpoint. If you need ATs from the authorization endpoint, you need to use a different grant type. See the OAUTH spec for more.
3) Where is the parameter client_name=CasOAuthClient coming from? Is the CAS server trying to act as an OAuth2 client?
From the above link,
... almost all protocols supported by CAS operate with the same exact intentions. A given CAS deployment is equipped with an embedded “plugin” that knows how to speak SAML2 and CAS, OAuth2 and CAS, or OpenID Connect and CAS or whatever. The right-hand side of that equation is always CAS when you consider, as an example, the following authentication flow with an OAuth2-enabled client application:
- The CAS deployment has turned on the OAuth2 plugin.
- An OAuth2 authorization request is submitted to the relevant CAS endpoint.
- The OAuth2 plugin verifies the request and translates it to a CAS authentication request!
- The authentication request is routed to the relevant CAS login endpoint.
- User authenticates and CAS routes the flow back to the OAuth2 plugin, having issued a service ticket for the plugin.
- The OAuth2 plugin attempts to validate that ticket to retrieve the necessary user profile and attributes.
- The OAuth2 plugin then proceeds to issue the right OAuth2 response by translating and transforming the profile and validated assertions into what the client application may need.
Also, extracted from this link:
... all protocols are clients of the CAS server that interact with it using the CAS protocol. This is done at the request/browser level, as opposed to doing things internally via heavily customized webflows and such that would be entangled with one another. The protocol modules that exist in CAS make zero assumptions about the internal inner workings of the CAS authentication flow/engine. They treat it just like they would an external CAS server; the only difference is, they sit and live inside the CAS server directly and yet they remain completely agnostic of that fact. Simply put in our example, the SAML2 module basically says: “this incoming request needs to be authenticated. So I’ll route it to a CAS server for authentication and when it comes back, I’ll do my bit”.