Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(providers): add BoxyHQ SAML Jackson provider #3782

Merged
merged 24 commits into from Mar 5, 2022

Conversation

deepakprabhakara
Copy link
Contributor

@deepakprabhakara deepakprabhakara commented Feb 2, 2022

https://github.com/boxyhq/jackson is an open-source SAML SSO service that implements SAML login as an OAuth 2.0 flow. Adding it as a provider here for the convenience of our users.

Reasoning 💡

This simplifies the usage for our customers and we hope other NextAuth users will find our SAML integration useful for their enterprise apps.

Checklist 🧢

Affected issues 🎟

n/a

Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looking good, but I added some comments. Could you also provide a screenshot of a successful login for future reference?

src/providers/saml-jackson.ts Outdated Show resolved Hide resolved
src/providers/saml-jackson.ts Outdated Show resolved Hide resolved
src/providers/saml-jackson.ts Outdated Show resolved Hide resolved
src/providers/saml-jackson.ts Outdated Show resolved Hide resolved
@deepakprabhakara
Copy link
Contributor Author

Thanks @balazsorban44, I'll address the suggestions shortly.

@deepakprabhakara
Copy link
Contributor Author

Screenshot-BoxyHQ-example

@deepakprabhakara
Copy link
Contributor Author

Thanks @balazsorban44, for very useful suggestions. I wasn't aware of a few things you mentioned there.

@vercel
Copy link

vercel bot commented Feb 4, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nextauthjs/next-auth/EwMwyrpaeKHLXsvFLsmH9m2r443B
✅ Preview: https://next-auth-git-fork-boxyhq-boxyhq-saml-nextauthjs.vercel.app

[Deployment for ab81e1a canceled]

@vercel vercel bot temporarily deployed to Preview February 4, 2022 18:29 Inactive
@github-actions github-actions bot removed providers core Refers to `@auth/core` labels Feb 4, 2022
@vercel vercel bot temporarily deployed to Preview February 5, 2022 00:04 Inactive
@vercel vercel bot temporarily deployed to Preview February 5, 2022 00:21 Inactive
@github-actions github-actions bot added core Refers to `@auth/core` docs providers labels Feb 5, 2022
@deepakprabhakara
Copy link
Contributor Author

@balazsorban44 Adjusted the code for the monorepo changes but unable to test due to some issues with running the dev app, will look into it soon. nextauthjs/docs#217 can be closed

@vercel vercel bot temporarily deployed to Preview February 6, 2022 00:58 Inactive
# Conflicts:
#	docs/providers.json
@vercel vercel bot temporarily deployed to Preview March 1, 2022 23:35 Inactive
@github-actions github-actions bot removed the documentation Relates to documentation label Mar 1, 2022
@vercel vercel bot temporarily deployed to Preview March 1, 2022 23:40 Inactive
@vercel vercel bot temporarily deployed to Preview March 1, 2022 23:53 Inactive
@vercel vercel bot temporarily deployed to Preview March 2, 2022 00:14 Inactive
@deepakprabhakara
Copy link
Contributor Author

@balazsorban44 Thanks again for the review, I have made the necessary changes and also added an example for you to test.

@vercel vercel bot temporarily deployed to Preview March 4, 2022 00:17 Inactive
@balazsorban44
Copy link
Member

Checking this now 👍

Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Besides the minor concerns and formatting preferences, is there a way to use consistent naming in all places?

I am seeing BoxyHQ SAML Jackson and all its permutations in different places:

  • BoxyHQ SAML Jackson
  • "boxyhq-saml"
  • "saml"
  • SAMLJacksonProfile
  • BoxyHQSAMLProvider
  • SAML Jackson

We should try to stick to a similar name, derived from the same brand naming in all places like docs, TypeScript, function names, ids, etc.

Could we unify these? 🙏

apps/dev/pages/api/auth/[...nextauth].ts Outdated Show resolved Hide resolved
Comment on lines +34 to +35
clientId: "dummy", // The dummy here is necessary since we'll pass tenant and product custom attributes in the client code
clientSecret: "dummy", // The dummy here is necessary since we'll pass tenant and product custom attributes in the client code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that I understand this correctly. These values are always dummy? 🤔

It might be my limited knowledge of SAML, but setting a hardcoded clientSecret does not sound right in OAuth 2.0. What am I missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@balazsorban44 Please see here - #3782 (comment). User can opt for a proper clientSecret or the convenience of tenant and product.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this configuration can be set during deployment to change the default dummy value - https://boxyhq.com/docs/jackson/deploy/env-variables#client_secret_verifier

docs/docs/providers/boxyhq-saml.md Outdated Show resolved Hide resolved
packages/next-auth/src/providers/boxyhq-saml.ts Outdated Show resolved Hide resolved
packages/next-auth/src/providers/boxyhq-saml.ts Outdated Show resolved Hide resolved
packages/next-auth/src/providers/boxyhq-saml.ts Outdated Show resolved Hide resolved
packages/next-auth/src/providers/boxyhq-saml.ts Outdated Show resolved Hide resolved
@balazsorban44
Copy link
Member

I have to add, the demo provider is wonderful, I wish most providers would have a public example like that 🙏 ✨

- env var default values moved to env.local.example
- consistent naming and use of id
@vercel vercel bot temporarily deployed to Preview March 4, 2022 17:50 Inactive
@deepakprabhakara
Copy link
Contributor Author

Adding a screenshot of our hosted demo: Screenshot 2022-03-04 at 18 26 07

@deepakprabhakara
Copy link
Contributor Author

I have to add, the demo provider is wonderful, I wish most providers would have a public example like that 🙏 ✨

Thanks @balazsorban44 🙏, we built the Mock SAML tool specifically for this purpose (and to ease testing as well).

Copy link
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@balazsorban44 balazsorban44 merged commit 001354e into nextauthjs:main Mar 5, 2022
@deepakprabhakara
Copy link
Contributor Author

Many thanks @balazsorban44!

@deepakprabhakara deepakprabhakara deleted the boxyhq-saml branch March 19, 2022 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` providers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants