T
tRPC

CAS Authentication

CAS Authentication

PMPatryk Makowski11/17/2022
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 Anyone has any idea how to do it? 😄
UUUnknown User11/17/2022
2 Messages Not Public
Sign In & Join Server To View
PMPatryk Makowski11/18/2022
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?
UUUnknown User11/18/2022
2 Messages Not Public
Sign In & Join Server To View
PMPatryk Makowski11/22/2022
https://apereo.github.io/cas/6.6.x/authentication/OAuth-Authentication.html Do you think that I could use that with NextAuth?
UUUnknown User11/28/2022
2 Messages Not Public
Sign In & Join Server To View
PMPatryk Makowski11/28/2022
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 šŸ˜•

Looking for more? Join the community!

T
tRPC

CAS Authentication

Join Server
Recommended Posts
Difference in type inference for vanilla client?Hello, querying an endpoint with the vanilla tRPC client but at runtime the actual result isn't the Zod Error MiddlewareHey lovely people. At Cal.com we make heavy use of `zod` for data validation. I was wondering if theclear cookie onErrorI'd like to clear a cookie (in nextjs) when a 403 error happens. I've been looking at the global errRequest context from getServerSidePropsThe docs of tRPC context https://trpc.io/docs/v10/context ``` export async function createContext(oAuth with passport.jsEvening all, Has anyone successfully setup trpc with passport.js for auth?Object keeps getting overwrittenI feel like i'm missing something fundamental here. when I add a new entry into object ``b`` it resAccessToken for API callsWhat would be the best approach to pass the AccessToken from NextAuth Session to the Http Client whiRequest or Response Specification Definition DocumentI am developing a backend service using trpc, but I need to dispatch trpc in another programming lanabortOnUnmount config errorI'm encountering an error when passing abortOnUnmount saying that it does not exist as a possible pazustand + trpc (basic data fetching)im trying to use zustand with trpc, but having trouble setting some data to global state. What am i TypeError Cannot destructure property 'abortOnUnmount' of 'useContext(...)' as it is null.Zero Clue what is error mean exactly....First time learning trpc really good tool. help with setting cookies on front end.Hello how do you use tRPC to make a cookie and send it to the front end. or is there any other methoHow do we add settings in each query like before?Since the new update, bee super confused. I used to do this, and can't recreate it now. ``` const Handling error globallyAccording to the docs on errors https://trpc.io/docs/v10/error-handling I should get such error objecant access trpc endpoints via the browseri'm converting some express endpoints to trpc, and I cant figure out how to access my endpoints via tRPC without SSRWhen using tRPC with ssr it uses `getInitialProps`, which has kinda of a cool effect in terms how a trpc + expo react native issueDoes anyone know how to solve this? Im not familiar with webpack at all. I’m a junior frontend.Can you chain middlewares in v10?Would I be able to make a rate limit and isAuthed middleware, then put queries behind both middlewarLoad data client-side via react-query while using tRPC with SSRIs there any way to load data client-side when using tRPC? I want my page to be rendered and load daServing clients in another repository?Would it be possible for tRPC to act as a server for clients in another repository and if so how wou