CAS Authentication

So long story short. My University is using CAS as authentication provider. I was thinking that I could use NextAuth with it to authenticate my users but I have no clue how am I supposed to do that. They don't support OAuth2 because they have old version of CAS. I asked on GH discussion in NextAuth for help but didn't get any. I also tried seeking help on Theo's discord twice this month but no luck. I don't know what to do and I feel like people working there have no clue what to do. I really want to be using TRPC with NextJS as I love this combo but how on earth can I authenticate my users using something like this? I was told I could use this lib https://www.npmjs.com/package/node-cas-client
npm
node-cas-client
NodeJS of CAS client.. Latest version: 1.0.0, last published: 6 years ago. Start using node-cas-client in your project by running npm i node-cas-client. There are no other projects in the npm registry using node-cas-client.
7 Replies
Patryk Makowski
Anyone has any idea how to do it? 😥
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Patryk Makowski
I'm going to use a docker to host it on university's servers, so no serverless env. But I'm using it with NextJs so I'd like to be able to still use the generated client with useQuery etc. 😕 Do you think I could use https://trpc.io/docs/middlewares to achieve the same as they mention in docs?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Patryk Makowski
https://apereo.github.io/cas/6.6.x/authentication/OAuth-Authentication.html Do you think that I could use that with NextAuth?
CAS - OAuth Authentication
CAS - Enterprise Single Sign-On for the Web
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Patryk Makowski
Yeah, I thought of that but it would be going around the problem, not connecting to CAS at all. Currently I managed to convince team to update CAS from 4.x to 6.x and they enabled OAuth for me. This made possible using custom OAuth but rn the only issue is connected with some settings in the CAS so I just have to wait for the team. Thanks a lot for having me still in the back of your head and trying to help. I hope the issue will be resolved with this OAuth setup and I'll let you know if that will be the case. Yes, it works! But I don't know why when I'm using NextAuth middleware and I successfully log In (I can see session when I disable middleware and use useSession hook on index page) it still redirects me to login page 😕