From 9247495feedebb90502878ebd2d0614b6db055f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 5 Dec 2020 14:15:55 +0100 Subject: [PATCH 01/11] chore: use stale label, instead of wontfix --- .github/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index 6cf5f35ebd..449d0b9e6f 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -8,7 +8,7 @@ exemptLabels: - security - priority # Label to use when marking an issue as stale -staleLabel: wontfix +staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > Hi there! It looks like this issue hasn't had any activity for a while. From b2c1f320572be965248852883bfdf93bfa858579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 5 Dec 2020 14:19:45 +0100 Subject: [PATCH 02/11] chore: add link to issue explaining stalebot --- .github/stale.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/stale.yml b/.github/stale.yml index 449d0b9e6f..1af78c11f9 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -13,10 +13,12 @@ staleLabel: stale markComment: > Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue - is still relevant, feel free to comment on it to keep ot open. Thanks! + is still relevant, feel free to comment on it to keep ot open. (Read more at #912) + Thanks! # Comment to post when closing a stale issue. Set to `false` to disable closeComment: > Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment - and I will reopen it. Thanks! + and I will reopen it. (Read more at #912) + Thanks! From 7d1168637d5136e2382ab45d7319f3326cffbc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 5 Dec 2020 16:30:09 +0100 Subject: [PATCH 03/11] chore: fix typo in stalebot comment --- .github/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index 1af78c11f9..87267808c0 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -13,7 +13,7 @@ staleLabel: stale markComment: > Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue - is still relevant, feel free to comment on it to keep ot open. (Read more at #912) + is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks! # Comment to post when closing a stale issue. Set to `false` to disable closeComment: > From 610ab39b40490f84ec963640aff74d0550ff106d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 5 Dec 2020 18:53:31 +0100 Subject: [PATCH 04/11] chore: run build GitHub Action on canary also --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfaad312c5..c00431e4d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,9 @@ name: Build Test on: push: - branches: [ main ] + branches: [ main, canary ] pull_request: - branches: [ main ] + branches: [ main, canary ] jobs: build: From e4cc3a92e5c533e647ee62a0716bba2269ee40c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 5 Dec 2020 19:47:09 +0100 Subject: [PATCH 05/11] chore: run build GitHub Actions on canary as well --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c00431e4d0..e97ec9e910 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,13 @@ name: Build Test on: push: - branches: [ main, canary ] + branches: + - main + - canary pull_request: - branches: [ main, canary ] + branches: + - main + - canary jobs: build: From 6f067be7b002b7b5c7d38834e900cd082996b860 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 5 Dec 2020 21:40:12 +0100 Subject: [PATCH 06/11] chore: add reproduction section to questions --- .github/ISSUE_TEMPLATE/question.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md index 3beee1d9ab..6431f4f356 100644 --- a/.github/ISSUE_TEMPLATE/question.md +++ b/.github/ISSUE_TEMPLATE/question.md @@ -6,10 +6,13 @@ assignees: '' --- **Your question** -A clear and concise question. + **What are you trying to do** -A description of what you are trying to do, for context. + + +**Reproduction** + **Feedback** *Documentation refers to searching through [online documentation](https://next-auth.js.org), code comments and issue history. The example project refers to [next-auth-example](https://github.com/iaincollins/next-auth-example).* From 6e6a24a7af9b14847fdfcd91345a5d833f36a228 Mon Sep 17 00:00:00 2001 From: Vladimir Evdokimov Date: Sun, 6 Dec 2020 15:34:40 -0500 Subject: [PATCH 07/11] feat(provider): Add Azure Active Directory B2C (#809) * add provider: Microsoft * documentation * support no tenant setup * fix code style * chore: rename Microsoft provider to AzureADB2C * chore: alphabetical order in providers/index --- src/providers/azure-ad-b2c.js | 24 ++++++++++++++++++++++++ src/providers/index.js | 2 ++ www/docs/configuration/providers.md | 1 + www/docs/faq.md | 2 +- www/docs/providers/azure-ad-b2c.md | 28 ++++++++++++++++++++++++++++ www/sidebars.js | 1 + 6 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 src/providers/azure-ad-b2c.js create mode 100644 www/docs/providers/azure-ad-b2c.md diff --git a/src/providers/azure-ad-b2c.js b/src/providers/azure-ad-b2c.js new file mode 100644 index 0000000000..fbf8dc40b6 --- /dev/null +++ b/src/providers/azure-ad-b2c.js @@ -0,0 +1,24 @@ +export default (options) => { + const tenant = options.tenantId ? options.tenantId : 'common' + + return { + id: 'azure-ad-b2c', + name: 'Azure Active Directory B2C', + type: 'oauth', + version: '2.0', + params: { + grant_type: 'authorization_code' + }, + accessTokenUrl: `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`, + authorizationUrl: `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/authorize?response_type=code&response_mode=query`, + profileUrl: 'https://graph.microsoft.com/v1.0/me/', + profile: (profile) => { + return { + id: profile.id, + name: profile.displayName, + email: profile.userPrincipalName + } + }, + ...options + } +} diff --git a/src/providers/index.js b/src/providers/index.js index 62f4f229e3..27eb6d8d0b 100644 --- a/src/providers/index.js +++ b/src/providers/index.js @@ -1,6 +1,7 @@ import Apple from './apple' import Atlassian from './atlassian' import Auth0 from './auth0' +import AzureADB2C from './azure-ad-b2c' import Basecamp from './basecamp' import BattleNet from './battlenet' import Box from './box' @@ -27,6 +28,7 @@ export default { Atlassian, Auth0, Apple, + AzureADB2C, Basecamp, BattleNet, Box, diff --git a/www/docs/configuration/providers.md b/www/docs/configuration/providers.md index 1459c80c1c..d95d185221 100644 --- a/www/docs/configuration/providers.md +++ b/www/docs/configuration/providers.md @@ -14,6 +14,7 @@ NextAuth.js is designed to work with any OAuth service, it supports OAuth 1.0, 1 * [Apple](/providers/apple) * [Atlassian](/providers/atlassian) * [Auth0](/providers/auth0) +* [Azure Active Directory B2C](/providers/azure-ad-b2c) * [Basecamp](/providers/basecamp) * [Battle.net](/providers/battlenet) * [Box](/providers/box) diff --git a/www/docs/faq.md b/www/docs/faq.md index 3a4053558b..973b462a0f 100644 --- a/www/docs/faq.md +++ b/www/docs/faq.md @@ -23,7 +23,7 @@ You can use also NextAuth.js with any database using a custom database adapter, ### What authentication services does NextAuth.js support? -NextAuth.js includes built-in support for signing in with Apple, Atlassian, Auth0, Google, Battle.net, Box, AWS Cognito, Discord, Facebook, FusionAuth, GitHub, GitLab, Google, Open ID Identity Server, Mixer, Okta, Slack, Spotify, Twitch, Twitter and Yandex. +NextAuth.js includes built-in support for signing in with Apple, Atlassian, Auth0, Azure Active Directory B2C, Google, Battle.net, Box, AWS Cognito, Discord, Facebook, FusionAuth, GitHub, GitLab, Google, Open ID Identity Server, Mixer, Okta, Slack, Spotify, Twitch, Twitter and Yandex. NextAuth.js also supports email for passwordless sign in, which is useful for account recovery or for people who are not able to use an account with the configured OAuth services (e.g. due to service outage, account suspension or otherwise becoming locked out of an account). diff --git a/www/docs/providers/azure-ad-b2c.md b/www/docs/providers/azure-ad-b2c.md new file mode 100644 index 0000000000..a855e9d53d --- /dev/null +++ b/www/docs/providers/azure-ad-b2c.md @@ -0,0 +1,28 @@ +--- +id: azure-ad-b2c +title: Azure Active Directory B2C +--- + +## Documentation + +https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow + +## Configuration + +https://docs.microsoft.com/en-us/azure/active-directory-b2c/tutorial-create-tenant + +## Example + +```js +import Providers from 'next-auth/providers'; +... +providers: [ + Providers.AzureADB2C({ + clientId: process.env.AZURE_CLIENT_ID, + clientSecret: process.env.AZURE_CLIENT_SECRET, + scope: 'offline_access User.Read', + tenantId: process.env.AZURE_TENANT_ID, + }), +] +... +``` diff --git a/www/sidebars.js b/www/sidebars.js index 706e30e42e..b7f504c308 100644 --- a/www/sidebars.js +++ b/www/sidebars.js @@ -26,6 +26,7 @@ module.exports = { 'providers/apple', 'providers/atlassian', 'providers/auth0', + 'providers/azure-ad-b2c', 'providers/basecamp', 'providers/battle.net', 'providers/box', From 7bedd4afa9d2126841be8d8e98be8eb965ebc3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sun, 6 Dec 2020 21:43:13 +0100 Subject: [PATCH 08/11] Revert "feat(provider): Add Azure Active Directory B2C (#809)" (#919) This reverts commit 6e6a24a7af9b14847fdfcd91345a5d833f36a228. --- src/providers/azure-ad-b2c.js | 24 ------------------------ src/providers/index.js | 2 -- www/docs/configuration/providers.md | 1 - www/docs/faq.md | 2 +- www/docs/providers/azure-ad-b2c.md | 28 ---------------------------- www/sidebars.js | 1 - 6 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 src/providers/azure-ad-b2c.js delete mode 100644 www/docs/providers/azure-ad-b2c.md diff --git a/src/providers/azure-ad-b2c.js b/src/providers/azure-ad-b2c.js deleted file mode 100644 index fbf8dc40b6..0000000000 --- a/src/providers/azure-ad-b2c.js +++ /dev/null @@ -1,24 +0,0 @@ -export default (options) => { - const tenant = options.tenantId ? options.tenantId : 'common' - - return { - id: 'azure-ad-b2c', - name: 'Azure Active Directory B2C', - type: 'oauth', - version: '2.0', - params: { - grant_type: 'authorization_code' - }, - accessTokenUrl: `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`, - authorizationUrl: `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/authorize?response_type=code&response_mode=query`, - profileUrl: 'https://graph.microsoft.com/v1.0/me/', - profile: (profile) => { - return { - id: profile.id, - name: profile.displayName, - email: profile.userPrincipalName - } - }, - ...options - } -} diff --git a/src/providers/index.js b/src/providers/index.js index 27eb6d8d0b..62f4f229e3 100644 --- a/src/providers/index.js +++ b/src/providers/index.js @@ -1,7 +1,6 @@ import Apple from './apple' import Atlassian from './atlassian' import Auth0 from './auth0' -import AzureADB2C from './azure-ad-b2c' import Basecamp from './basecamp' import BattleNet from './battlenet' import Box from './box' @@ -28,7 +27,6 @@ export default { Atlassian, Auth0, Apple, - AzureADB2C, Basecamp, BattleNet, Box, diff --git a/www/docs/configuration/providers.md b/www/docs/configuration/providers.md index d95d185221..1459c80c1c 100644 --- a/www/docs/configuration/providers.md +++ b/www/docs/configuration/providers.md @@ -14,7 +14,6 @@ NextAuth.js is designed to work with any OAuth service, it supports OAuth 1.0, 1 * [Apple](/providers/apple) * [Atlassian](/providers/atlassian) * [Auth0](/providers/auth0) -* [Azure Active Directory B2C](/providers/azure-ad-b2c) * [Basecamp](/providers/basecamp) * [Battle.net](/providers/battlenet) * [Box](/providers/box) diff --git a/www/docs/faq.md b/www/docs/faq.md index 973b462a0f..3a4053558b 100644 --- a/www/docs/faq.md +++ b/www/docs/faq.md @@ -23,7 +23,7 @@ You can use also NextAuth.js with any database using a custom database adapter, ### What authentication services does NextAuth.js support? -NextAuth.js includes built-in support for signing in with Apple, Atlassian, Auth0, Azure Active Directory B2C, Google, Battle.net, Box, AWS Cognito, Discord, Facebook, FusionAuth, GitHub, GitLab, Google, Open ID Identity Server, Mixer, Okta, Slack, Spotify, Twitch, Twitter and Yandex. +NextAuth.js includes built-in support for signing in with Apple, Atlassian, Auth0, Google, Battle.net, Box, AWS Cognito, Discord, Facebook, FusionAuth, GitHub, GitLab, Google, Open ID Identity Server, Mixer, Okta, Slack, Spotify, Twitch, Twitter and Yandex. NextAuth.js also supports email for passwordless sign in, which is useful for account recovery or for people who are not able to use an account with the configured OAuth services (e.g. due to service outage, account suspension or otherwise becoming locked out of an account). diff --git a/www/docs/providers/azure-ad-b2c.md b/www/docs/providers/azure-ad-b2c.md deleted file mode 100644 index a855e9d53d..0000000000 --- a/www/docs/providers/azure-ad-b2c.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -id: azure-ad-b2c -title: Azure Active Directory B2C ---- - -## Documentation - -https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow - -## Configuration - -https://docs.microsoft.com/en-us/azure/active-directory-b2c/tutorial-create-tenant - -## Example - -```js -import Providers from 'next-auth/providers'; -... -providers: [ - Providers.AzureADB2C({ - clientId: process.env.AZURE_CLIENT_ID, - clientSecret: process.env.AZURE_CLIENT_SECRET, - scope: 'offline_access User.Read', - tenantId: process.env.AZURE_TENANT_ID, - }), -] -... -``` diff --git a/www/sidebars.js b/www/sidebars.js index b7f504c308..706e30e42e 100644 --- a/www/sidebars.js +++ b/www/sidebars.js @@ -26,7 +26,6 @@ module.exports = { 'providers/apple', 'providers/atlassian', 'providers/auth0', - 'providers/azure-ad-b2c', 'providers/basecamp', 'providers/battle.net', 'providers/box', From cec46b0d67f8c2e2e7462da68db3209b62eff02b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Mon, 7 Dec 2020 22:33:18 +0100 Subject: [PATCH 09/11] =?UTF-8?q?chore:=20add=20myself=20to=20the=20contri?= =?UTF-8?q?butors=20list=20=F0=9F=99=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/docs/contributors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/www/docs/contributors.md b/www/docs/contributors.md index 210718f9f0..6ff49112cd 100644 --- a/www/docs/contributors.md +++ b/www/docs/contributors.md @@ -12,6 +12,7 @@ title: Contributors * Gerald Nolan * Lluis Agusti * Jefferson Bledsoe +* Balázs Orbán _Special thanks to Lori Karikari for creating most of the providers, to Nico Domino for creating this site, to Fredrik Pettersen for creating the Prisma adapter, to Gerald Nolan for adding support for Sign in with Apple, to Lluis Agusti for work to add TypeScript definitions and to Jefferson Bledsoe for working on automating testing._ From 9242b4cd6a0b61b1450c9fb4933a0cb5709c8625 Mon Sep 17 00:00:00 2001 From: Haldun Anil Date: Tue, 8 Dec 2020 15:33:00 -0500 Subject: [PATCH 10/11] docs: fix incorrect references in cypress docs --- www/docs/tutorials/testing-with-cypress.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/docs/tutorials/testing-with-cypress.md b/www/docs/tutorials/testing-with-cypress.md index 45ab28dd7a..7708868fc0 100644 --- a/www/docs/tutorials/testing-with-cypress.md +++ b/www/docs/tutorials/testing-with-cypress.md @@ -36,7 +36,7 @@ Second, a cypress file for environment variables. These can be defined in `cypre { "GOOGLE_USER": "username@company.com", "GOOGLE_PW": "password", - "COOKIE_NAME": "__Secure-next-auth.session-token", + "COOKIE_NAME": "next-auth.session-token", "SITE_NAME": "http://localhost:3000" } ``` @@ -111,7 +111,7 @@ describe('Login page', () => { }) Cypress.Cookies.defaults({ - whitelist: cookieName, + preserve: cookieName, }) cy.visit('/api/auth/signout') cy.get('form').submit() From c1ece28a583348ea5e9282cdab73b3aa3acfb4b0 Mon Sep 17 00:00:00 2001 From: Haldun Anil Date: Tue, 8 Dec 2020 15:36:39 -0500 Subject: [PATCH 11/11] chore: add additional docs clarification --- www/docs/tutorials/testing-with-cypress.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/docs/tutorials/testing-with-cypress.md b/www/docs/tutorials/testing-with-cypress.md index 7708868fc0..eeb6bf78aa 100644 --- a/www/docs/tutorials/testing-with-cypress.md +++ b/www/docs/tutorials/testing-with-cypress.md @@ -113,6 +113,9 @@ describe('Login page', () => { Cypress.Cookies.defaults({ preserve: cookieName, }) + + // remove the two lines below if you need to stay logged in + // for your remaining tests cy.visit('/api/auth/signout') cy.get('form').submit() }