hoarder icon indicating copy to clipboard operation
hoarder copied to clipboard

[Feature request] NextAuth Providers for OAuth/SSO

Open schmoaaaaah opened this issue 2 years ago • 6 comments

The ability to use the NextAuth Providers for OAuth Authentication would be nice.

schmoaaaaah avatar Apr 09 '24 14:04 schmoaaaaah

Agreed, any sort of external would be great!

linedpaper avatar Jun 04 '24 22:06 linedpaper

which providers would be most interesting? there are 60+ proviers, that is a bit much ;-)

kamtschatka avatar Jun 05 '24 07:06 kamtschatka

@kamtschatka I'd add only the generic oauth one

MohamedBassem avatar Jun 05 '24 07:06 MohamedBassem

You could also do it with big ENV vars:

providers: |
  AuthentikProvider({
    clientId: process.env.AUTHENTIK_ID,
    clientSecret: process.env.AUTHENTIK_SECRET,
    issuer: process.env.AUTHENTIK_ISSUER,
  })

and add them to the provideres array in Nextauth, but I agree the Generic Oauth would be easier to implement.

schmoaaaaah avatar Jun 05 '24 08:06 schmoaaaaah

I don't know anything about Nextauth but any generic OAuth or SAML implementation would be good. Whichever you find easiest to implement.

SeeJayEmm avatar Jun 05 '24 11:06 SeeJayEmm

+1 , any generic oauth will be good.

gtzapper avatar Jul 10 '24 15:07 gtzapper

For all the people waiting for SSO, it's now released in version 0.17 and you have @kamtschatka to thank for that! I know that this was a popular request and it took us some time to get to it, but it's finally here!

Note, if the account is created for the first time using SSO (no password configured), you'll have to use the new "login by API keys" in the extension and the mobile apps. The new mobile app versions that introduce this feature are currently under review by google/apple.

If you already have an account, and you want to link it with the SSO account after configuring it, you'll want to set OAUTH_ALLOW_DANGEROUS_EMAIL_ACCOUNT_LINKING=true.

Give it a try and let us know if you have any questions!

MohamedBassem avatar Sep 22 '24 16:09 MohamedBassem

@MFYDev I've just pushed the new documentation version, you can find it here: https://docs.hoarder.app/configuration#authentication--signup :)

Sorry I should have linked that earlier!

MohamedBassem avatar Sep 22 '24 16:09 MohamedBassem

Thank you, just tested and it is working well with Authentik, however can we get an option to disable the default password log in form?

MFYDev avatar Sep 22 '24 16:09 MFYDev

@MFYDev Glad that it's working well! I think this is a reasonable feature request. Can you file a separate issue for it? Shouldn't be too hard to implement :)

MohamedBassem avatar Sep 22 '24 16:09 MohamedBassem

Sure, thank you, on it!

MFYDev avatar Sep 22 '24 16:09 MFYDev

@MohamedBassem Done, just created the FR

MFYDev avatar Sep 22 '24 16:09 MFYDev