next-auth icon indicating copy to clipboard operation
next-auth copied to clipboard

feat(providers): add Azure DevOps provider

Open nawok opened this issue 3 years ago • 4 comments

☕️ Reasoning

This pull request adds the new AzureDevOpsProvider which allows authenticating with Azure DevOps and getting tokens for calling the APIs.

I accidentally reset my branch and my previous PR #4697 was closed.

🧢 Checklist

  • [x] Documentation
  • [ ] Tests
  • [x] Ready to be merged

🎫 Affected issues

Implements: #4688

📌 Resources

nawok avatar Jun 10 '22 13:06 nawok

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) Aug 27, 2023 0:28am
auth-docs-nextra ❌ Failed (Inspect) Aug 27, 2023 0:28am
2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
next-auth ⬜️ Ignored (Inspect) Aug 27, 2023 0:28am
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Aug 27, 2023 0:28am

vercel[bot] avatar Jun 10 '22 13:06 vercel[bot]

Dear @ThangHuuVu, @lluia, please let me know if you want me to set up an application in Azure DevOps so you can verify that the provider works.

nawok avatar Aug 02 '22 07:08 nawok

I decided to improve my pull request slightly (hope you find these additions helpful).

  • Deployed NextAuth Example with Azure DevOps provider: https://next-auth-azure-devops.vercel.app
  • The provider is copied “as-is” from this pull request and the full diff and usage can be found here: https://github.com/nawok/next-auth-example/compare/main...nawok:next-auth-example:provider/azure-devops?expand=1

nawok avatar Sep 04 '22 11:09 nawok

LGTM too. I can confirm the preview URL login with AzureDevops worked for me :+1:

@ThangHuuVu - I also created a Test application and saved the clientId / clientSecret's in our 1Password :+1:

ndom91 avatar Sep 21 '22 13:09 ndom91

~~I also added a little fix for eslint’s incorrect suggestion to use ?? inside if condition.~~[^] [^]: Removed after rebase on main.

next-auth:lint: next-auth/packages/next-auth/src/utils/detect-host.ts
next-auth:lint:   4:26  error  Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator  @typescript-eslint/prefer-nullish-coalescing

Other options to address that would be:

  • either with a // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
  • or an explicit “booleaning” Boolean(process.env.VERCEL) || Boolean(process.env.AUTH_TRUST_HOST)

nawok avatar Oct 16 '22 07:10 nawok

+1. Would love to see this integrated.

thejessewinton avatar Nov 08 '22 20:11 thejessewinton

@nawok is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 18 '22 18:12 vercel[bot]

After updating this PR I noticed that the legacy label was applied. What should I update/improve to modernize it?

nawok avatar Dec 31 '22 23:12 nawok

Hi @nawok to get rid of the legacy label, could you help move the change under: https://github.com/nextauthjs/next-auth/tree/main/packages/core/src/providers

And the docs do not need to be written manually anymore - make sure to add proper JSDoc comments, for example https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/auth0.ts

ThangHuuVu avatar Jan 24 '23 12:01 ThangHuuVu

@ThangHuuVu, thanks, got it! I will take care of it and the one related to Dribbble. #5626

nawok avatar Jan 24 '23 15:01 nawok

Is incorporating the docs as JSDoc a recommended way?

I found a separate Markdown has a better DX because of auto formatting and local preview. Please, have a look. There are some strange types generated on the bottom of the page and I cannot figure out what I am missing to make the page look nicer.

nawok avatar Jan 24 '23 21:01 nawok

Is incorporating the docs as JSDoc a recommended way?

I found a separate Markdown has a better DX because of auto formatting and local preview. Please, have a look. There are some strange types generated on the bottom of the page and I cannot figure out what I am missing to make the page look nicer.

Yeah so we use the jsdoc comments to autogenerate the API reference docs. That way the documentation and types shown on hover inside your editor and the reference docs pages, are based on the same information. Of course it comes with some downsides, but having nice vscode built-in docs and maintaining only 1 set seems worth it.

In regard to the strange types at the bottom of the page, what exactly are you referring to?

ndom91 avatar Jan 24 '23 22:01 ndom91

Hi Nico, yeah, makes sense. Helps to keep the docs in sync as well.

I was talking about this options’s type signature. I just checked other providers and it seems like the type «explodes» if you add an extra field to it. I just thought I did something wrong but now I see that I’m not alone—and this is just the way it is.

nawok avatar Jan 24 '23 22:01 nawok

Hi @ThangHuuVu, I will have a look today. Thank you for starting the review.

nawok avatar Aug 27 '23 08:08 nawok

Hey @ThangHuuVu, I rebased my changes on top of the latest main, simplified it a bit, and I also redeployed the example app and here is its diff with the stock version.

Can you give it another try, please?

nawok avatar Aug 27 '23 10:08 nawok

Regarding the images, I was hesitating because of Microsoft's guidelines regarding their assets. I can create a proper icon of matching style and size if you insist.

Don’t use Microsoft’s logos, icons, or designs, in any manner.

nawok avatar Aug 27 '23 12:08 nawok

Re-added the endpoint URLs and updated the bug template dropdown options.

nawok avatar Aug 27 '23 12:08 nawok

Woa, that is some strict guidelines. It should not be a blocker, though.

ThangHuuVu avatar Aug 27 '23 13:08 ThangHuuVu

merged, thanks again @nawok!

ThangHuuVu avatar Aug 27 '23 13:08 ThangHuuVu