RocketChat / RC4Conferences

A set of scalable components for communities to build, manage, and run virtual conferences of any size.
https://conf.rceng.shop/conferences/c/1
24 stars 40 forks source link

Migrate current authentication setup to NextAuth #96

Closed adarsh500 closed 1 year ago

adarsh500 commented 1 year ago

This PR Completes #42

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

Dnouv commented 1 year ago

Hey @adarsh500 Any updates for this PR?

Thanks!

adarsh500 commented 1 year ago

It's almost complete, the only thing left to do is 2FA with Google oauth. There are a couple of ways we could do this

  1. use a combination of the current gapi with nextAuth or
  2. Write a custom NextAuth provider (there is a possibility that this might require some backend changes)

I aim to finish it by this weekend, please let me know if you have any thoughts/suggestions. Thanks :)

Dnouv commented 1 year ago

Hello @adarsh500

Write a custom NextAuth provider (there is a possibility that this might require some backend changes)

We would prefer it to be done this way to maintain the Auth consistency. Thank you!

Dnouv commented 1 year ago

Hey @adarsh500, any updates on this PR? If there are any, please let us know.

Thanks!

adarsh500 commented 1 year ago

Hey @Dnouv, i'm stuck trying to figure out how to pass additional parameters to the next auth API while signing up with google. As of now we can't use a state param because the library does not support it as it would conflict with the state param that the library uses internally. This is the last part of it and I'm stuck here, any help would be appreciated, thanks

Dnouv commented 1 year ago

Why would you need to pass extra param? Are you trying to pass the 2fa token?

Dnouv commented 1 year ago

@adarsh500 if it's something related to 2fa, in RC you can pass the 2fa token as a header:

-H "X-2fa-code: $SHA_256_HASH_OF_API_USER_PASSWORD" \
-H "X-2fa-method: password" 
Dnouv commented 1 year ago

Hey @adarsh500

Any progress?

Thanks!

adarsh500 commented 1 year ago

Hey @Dnouv, 2FA works flawlessly, thanks for helping me out with the last part. It's ready for review

Dnouv commented 1 year ago

@adarsh500 could you please resolve the conflicts and the failing tests? Thank you!

adarsh500 commented 1 year ago

@Dnouv will resolve the conflicts and failed test today