Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/2_bug_provider.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ body:
- "SimpleLogin"
- "Slack"
- "Spotify"
- "SSOJet"
- "Strava"
- "Threads"
- "Tiktok"
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pnpm-lock.yaml
*.d.ts
*.d.ts.map
**/*.sh
**/*.svg

.svelte-kit
.next
Expand Down
6 changes: 6 additions & 0 deletions apps/examples/nextjs/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Reddit from "next-auth/providers/reddit"
import Slack from "next-auth/providers/slack"
import Salesforce from "next-auth/providers/salesforce"
import Spotify from "next-auth/providers/spotify"
import SSOJet from "next-auth/providers/ssojet"
import Twitch from "next-auth/providers/twitch"
import Twitter from "next-auth/providers/twitter"
import Vipps from "next-auth/providers/vipps"
Expand Down Expand Up @@ -91,6 +92,11 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
Reddit,
Salesforce,
Slack,
SSOJet({
clientId: process.env.AUTH_SSOJET_CLIENT_ID!,
clientSecret: process.env.AUTH_SSOJET_CLIENT_SECRET!,
issuer: process.env.AUTH_SSOJET_ISSUER!,
}),
Spotify,
Twitch,
Twitter,
Expand Down
1 change: 1 addition & 0 deletions docs/public/img/providers/ssojet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 93 additions & 0 deletions packages/core/src/providers/ssojet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/**
* <div class="provider" style={{display: "flex", justifyContent: "space-between", alignItems: "center"}}>
* <span style={{fontSize: "1.35rem" }}>
* Built-in sign in with <b>SSOJet</b> integration.
* </span>
* <a href="https://ssojet.com" style={{backgroundColor: "#1a1a1a", padding: "12px", borderRadius: "100%" }}>
* <img style={{display: "block"}} src="https://authjs.dev/img/providers/ssojet.svg" width="24"/>
* </a>
* </div>
*
* @module providers/ssojet
*/
import type { OIDCConfig, OIDCUserConfig } from "./index.js"

/** The returned user profile from SSOJet when using the profile callback. */
export interface SSOJetProfile extends Record<string, any> {
/** The user's unique identifier. */
sub: string
/** The user's email address. */
email: string
/** Indicates whether the user has verified their email address. */
email_verified: boolean
/** The user's full name. */
name: string
/** The user's given name. */
given_name: string
/** The user's family name. */
family_name: string
/** URL pointing to the user's profile picture. */
picture: string
/** The user's preferred username. */
preferred_username: string
/** The user's locale. */
locale: string
/** The user's timezone. */
zoneinfo: string
/** Timestamp indicating when the user profile was last updated. */
updated_at: number
}

/**
* ### Setup
*
* #### Callback URL
* ```
* https://example.com/api/auth/callback/ssojet
* ```
*
* #### Configuration
* ```ts
* import { Auth } from "@auth/core"
* import SSOJet from "@auth/core/providers/ssojet"
*
* const request = new Request(origin)
* const response = await Auth(request, {
* providers: [
* SSOJet({
* clientId: AUTH_SSOJET_CLIENT_ID,
* clientSecret: AUTH_SSOJET_CLIENT_SECRET,
* issuer: AUTH_SSOJET_ISSUER,
* }),
* ],
* })
* ```
*
* ### Resources
*
* - [SSOJet OIDC documentation](https://docs.ssojet.com/en/sso/quickstart/)
* - [SSOJet NextAuth.js integration guide](https://docs.ssojet.com/en/sso/quickstart/fullstack/nextjs/)
*
* ### Notes
*
* The SSOJet provider comes with a [default configuration](https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/ssojet.ts). To override the defaults for your use case, check out [customizing a built-in OAuth provider](https://authjs.dev/guides/configuring-oauth-providers).
*
* ## Help
*
* If you think you found a bug in the default configuration, you can [open an issue](https://authjs.dev/new/provider-issue).
*
* Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from
* the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec,
* we might not pursue a resolution. You can ask for more help in [Discussions](https://authjs.dev/new/github-discussions).
*/
export default function SSOJet(
config: OIDCUserConfig<SSOJetProfile>
): OIDCConfig<SSOJetProfile> {
return {
id: "ssojet",
name: "SSOJet",
type: "oidc",
style: { text: "#fff", bg: "#1a1a1a" },
options: config,
}
}