Skip to content

Commit

Permalink
feat(providers): Add Ping Identity provider (#6614)
Browse files Browse the repository at this point in the history
* adding ping identity provider

* converted to typescript and also made requested changes from next-auth team

* Update documentation, use OIDCConfig

* Apply suggestions from code review

* Update ping-id.ts

* Create ping-id.svg

* Update ping-id.svg

* Update ping-id.svg

---------

Co-authored-by: Falco Winkler <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>
  • Loading branch information
3 people authored Aug 16, 2024
1 parent 208410d commit ed6b48c
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
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 @@ -71,6 +71,7 @@ body:
- "Osso"
- "Osu"
- "Patreon"
- "Ping Identity"
- "Pipedrive"
- "Reddit"
- "Roblox"
Expand Down
18 changes: 18 additions & 0 deletions docs/public/img/providers/ping-id.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions packages/core/src/providers/ping-id.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import type { OIDCConfig, OIDCUserConfig } from "./index.js"

export interface PingProfile extends Record<string, any> {
iss: string
sub: string
aud: string
iat: number
exp: number
acr: string
amr: [string]
auth_time: number
at_hash: string
sid: string
preferred_username: string
given_name: string
picture: string
updated_at: number
name: string
family_name: string
email: string
env: string
org: string
"p1.region": string
}

/**
* Add PingId login to your page.
*
* ## Documentation
*
* - [Create App in Ping Identity](https://docs.pingidentity.com/r/en-us/pingone/p1_add_app_worker)
*
* ---
* ## Example
*
* ```ts
* import PingId from "@auth/core/providers/ping-id"
*
* ...
* providers: [
* PingId({
* clientId: AUTH_PING_ID_ID,
* clientSecret: AUTH_PING_ID_SECRET,
* issuer: PING_ID_ISSUER
* })
* ]
* ...
* ```
*
* ## 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 PingId(
options: OIDCUserConfig<PingProfile>
): OIDCConfig<PingProfile> {
return {
id: "ping-id",
name: "Ping Identity",
type: "oidc",
options,
}
}

0 comments on commit ed6b48c

Please sign in to comment.