mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
Compare commits
4 Commits
@auth/soli
...
revert-871
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
098f0a48ec | ||
|
|
46d02f750d | ||
|
|
3fd0d04546 | ||
|
|
a8985ab364 |
2
.github/ISSUE_TEMPLATE/1_bug_framework.yml
vendored
2
.github/ISSUE_TEMPLATE/1_bug_framework.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: Bug report
|
name: Bug report
|
||||||
description: Report an issue so we can improve
|
description: Report an issue so we can improve
|
||||||
labels: [triage]
|
labels: [triage, bug]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/2_bug_provider.yml
vendored
2
.github/ISSUE_TEMPLATE/2_bug_provider.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: Bug report (Provider)
|
name: Bug report (Provider)
|
||||||
description: Create a provider-specific report
|
description: Create a provider-specific report
|
||||||
labels: [triage, providers]
|
labels: [triage, bug, providers]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/3_bug_adapter.yml
vendored
2
.github/ISSUE_TEMPLATE/3_bug_adapter.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
name: Bug report (Adapter)
|
name: Bug report (Adapter)
|
||||||
description: Create an adapter-specific report
|
description: Create an adapter-specific report
|
||||||
labels: [triage, adapters]
|
labels: [triage, bug, adapters]
|
||||||
body:
|
body:
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
|
|||||||
3
.github/workflows/triage.yml
vendored
3
.github/workflows/triage.yml
vendored
@@ -14,10 +14,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Nissuer
|
- name: Nissuer
|
||||||
uses: balazsorban44/nissuer@1.3.5
|
uses: balazsorban44/nissuer@1.5.0
|
||||||
with:
|
with:
|
||||||
label-area-prefix: ""
|
label-area-prefix: ""
|
||||||
label-area-section: "[Provider|Adapter] type(.*)### Environment"
|
label-area-section: "[Provider|Adapter] type(.*)### Environment"
|
||||||
label-comments: '{ "incomplete": ".github/invalid-reproduction.md" }'
|
label-comments: '{ "incomplete": ".github/invalid-reproduction.md" }'
|
||||||
reproduction-link-section: "### Reproduction URL(.*)### Describe the issue"
|
reproduction-link-section: "### Reproduction URL(.*)### Describe the issue"
|
||||||
reproduction-invalid-label: "invalid reproduction"
|
reproduction-invalid-label: "invalid reproduction"
|
||||||
|
reproduction-issue-labels: "bug"
|
||||||
|
|||||||
@@ -8,17 +8,22 @@
|
|||||||
*
|
*
|
||||||
* @module providers/linkedin
|
* @module providers/linkedin
|
||||||
*/
|
*/
|
||||||
import type { OAuthConfig, OAuthUserConfig } from "./index.js"
|
import type { OIDCConfig, OIDCUserConfig } from "./index.js"
|
||||||
|
|
||||||
export interface LinkedInProfile {
|
/** @see https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2#response-body-schema */
|
||||||
sub: string
|
export interface LinkedInProfile extends Record<string, any> {
|
||||||
name: string
|
sub: string,
|
||||||
email: string
|
name: string,
|
||||||
picture: string
|
given_name: string,
|
||||||
|
family_name: string,
|
||||||
|
picture: string,
|
||||||
|
locale: string,
|
||||||
|
email: string,
|
||||||
|
email_verified: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add Linkedin login to your page.
|
* Add LinkedIn login to your page.
|
||||||
*
|
*
|
||||||
* ### Setup
|
* ### Setup
|
||||||
*
|
*
|
||||||
@@ -30,27 +35,27 @@ export interface LinkedInProfile {
|
|||||||
* #### Configuration
|
* #### Configuration
|
||||||
*```js
|
*```js
|
||||||
* import Auth from "@auth/core"
|
* import Auth from "@auth/core"
|
||||||
* import Linkedin from "@auth/core/providers/linkedin"
|
* import LinkedIn from "@auth/core/providers/linkedin"
|
||||||
*
|
*
|
||||||
* const request = new Request(origin)
|
* const request = new Request(origin)
|
||||||
* const response = await Auth(request, {
|
* const response = await Auth(request, {
|
||||||
* providers: [Linkedin({ clientId: LINKEDIN_CLIENT_ID, clientSecret: LINKEDIN_CLIENT_SECRET })],
|
* providers: [LinkedIn({ clientId: LINKEDIN_CLIENT_ID, clientSecret: LINKEDIN_CLIENT_SECRET })],
|
||||||
* })
|
* })
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* ### Resources
|
* ### Resources
|
||||||
*
|
*
|
||||||
* - [Linkedin OAuth documentation](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow)
|
* - [LinkedIn OAuth documentation](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow)
|
||||||
* - [Linkedin app console](https://www.linkedin.com/developers/apps/)
|
* - [LinkedIn app console](https://www.linkedin.com/developers/apps/)
|
||||||
*
|
*
|
||||||
* ### Notes
|
* ### Notes
|
||||||
*
|
*
|
||||||
* By default, Auth.js assumes that the Linkedin provider is
|
* By default, Auth.js assumes that the LinkedIn provider is
|
||||||
* based on the [OAuth 2](https://www.rfc-editor.org/rfc/rfc6749.html) specification.
|
* based on the [OIDC](https://openid.net/specs/openid-connect-core-1_0.html) specification.
|
||||||
*
|
*
|
||||||
* :::tip
|
* :::tip
|
||||||
*
|
*
|
||||||
* The Linkedin provider comes with a [default configuration](https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/linkedin.ts).
|
* The LinkedIn provider comes with a [default configuration](https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/linkedin.ts).
|
||||||
* To override the defaults for your use case, check out [customizing a built-in OAuth provider](https://authjs.dev/guides/providers/custom-provider#override-default-options).
|
* To override the defaults for your use case, check out [customizing a built-in OAuth provider](https://authjs.dev/guides/providers/custom-provider#override-default-options).
|
||||||
*
|
*
|
||||||
* :::
|
* :::
|
||||||
@@ -66,14 +71,22 @@ export interface LinkedInProfile {
|
|||||||
* :::
|
* :::
|
||||||
*/
|
*/
|
||||||
export default function LinkedIn<P extends LinkedInProfile>(
|
export default function LinkedIn<P extends LinkedInProfile>(
|
||||||
options: OAuthUserConfig<P>
|
options: OIDCUserConfig<P>
|
||||||
): OAuthConfig<P> {
|
): OIDCConfig<P> {
|
||||||
return {
|
return {
|
||||||
id: "linkedin",
|
id: "linkedin",
|
||||||
name: "LinkedIn",
|
name: "LinkedIn",
|
||||||
type: "oidc",
|
type: "oidc",
|
||||||
client: {
|
client: { token_endpoint_auth_method: "client_secret_post" },
|
||||||
token_endpoint_auth_method: "client_secret_post",
|
issuer: "https://www.linkedin.com",
|
||||||
|
jwks_endpoint: "https://www.linkedin.com/oauth/openid/jwks",
|
||||||
|
async profile(profile) {
|
||||||
|
return {
|
||||||
|
id: profile.sub,
|
||||||
|
name: profile.name,
|
||||||
|
email: profile.email,
|
||||||
|
image: profile.picture
|
||||||
|
}
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
logo: "/linkedin.svg",
|
logo: "/linkedin.svg",
|
||||||
|
|||||||
Reference in New Issue
Block a user