Skip to content

Commit

Permalink
feat(provider): add netlify (#555)
Browse files Browse the repository at this point in the history
Co-authored-by: styxlab <cws@DE01WP777.scdom.net>
Co-authored-by: Balázs Orbán <info@balazsorban.com>
  • Loading branch information
3 people committed Dec 6, 2020
1 parent 4635113 commit 12d7856
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/providers/index.js
Expand Up @@ -16,6 +16,7 @@ import Google from './google'
import IdentityServer4 from './identity-server4'
import LinkedIn from './linkedin'
import Mixer from './mixer'
import Netlify from './netlify'
import Okta from './okta'
import Slack from './slack'
import Spotify from './spotify'
Expand All @@ -42,6 +43,7 @@ export default {
IdentityServer4,
LinkedIn,
Mixer,
Netlify,
Okta,
Slack,
Spotify,
Expand Down
21 changes: 21 additions & 0 deletions src/providers/netlify.js
@@ -0,0 +1,21 @@
export default (options) => {
return {
id: 'netlify',
name: 'Netlify',
type: 'oauth',
version: '2.0',
params: { grant_type: 'authorization_code' },
accessTokenUrl: 'https://api.netlify.com/oauth/token',
authorizationUrl: 'https://app.netlify.com/authorize?response_type=code',
profileUrl: 'https://api.netlify.com/api/v1/user',
profile: (profile) => {
return {
id: profile.id,
name: profile.full_name,
email: profile.email,
image: profile.avatar_url
}
},
...options
}
}
1 change: 1 addition & 0 deletions www/docs/configuration/providers.md
Expand Up @@ -27,6 +27,7 @@ NextAuth.js is designed to work with any OAuth service, it supports OAuth 1.0, 1
* [IdentityServer4](/providers/identity-server4)
* [LinkedIn](/providers/LinkedIn)
* [Mixer](/providers/Mixer)
* [Netlify](/providers/Netlify)
* [Okta](/providers/Okta)
* [Slack](/providers/slack)
* [Spotify](/providers/spotify)
Expand Down
2 changes: 1 addition & 1 deletion www/docs/faq.md
Expand Up @@ -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, Google, Battle.net, Box, AWS Cognito, Discord, Facebook, FusionAuth, GitHub, GitLab, Google, Open ID Identity Server, Mixer, Netlify, 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).

Expand Down
26 changes: 26 additions & 0 deletions www/docs/providers/netlify.md
@@ -0,0 +1,26 @@
---
id: netlify
title: Netlify
---

## Documentation

https://www.netlify.com/blog/2016/10/10/integrating-with-netlify-oauth2/

## Configuration

https://github.com/netlify/netlify-oauth-example

## Example

```js
import Providers from `next-auth/providers`
...
providers: [
Providers.Netlify({
clientId: process.env.NETLIFY_CLIENT_ID,
clientSecret: process.env.NETLIFY_CLIENT_SECRET
})
}
...
```

0 comments on commit 12d7856

Please sign in to comment.