Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

oauth2-server-grant-type-apple

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oauth2-server-grant-type-apple

Apple grant type for oauth2-server

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

OAuth2 Server Apple Grant Type

Adds Apple grant type for oauth2-server

Installation

Using Yarn

yarn add oauth2-server-grant-type-apple

Using NPM

npm install oauth2-server-grant-type-apple

Usage

Add getUserWithApple to oauth2-server model.

  const getUserWithApple = async (jwtData) => {
    // Find and return user by Apple ID (sub in jwtData)

    // Find and return user by Apple email

    // If not exists create new user
  }

Add Apple grant type to extendedGrantTypes in oauth2-server options:

  import AppleGrantType from 'oauth2-server-grant-type-apple';

  const options = {
    model: ...,
    extendedGrantTypes: {
      apple: AppleGrantType,
    }
    requireClientAuthentication: {
      apple: false,
    },
  }

You need to provide Apple App ID in model appleGrantType :

const options = {
  model: {
    ...model,
    appleGrantType: {
      appId: 'com.example.apple.login' // Array also supported
    },
  },
}

Post request to /oauth/token with apple grant type and provided token:

{
  "grant_type": "apple",
  "client_id": "YOUR_CLIENT_ID",
  "apple_token": "APPLE_JWT_TOKEN",
  "name": "User full name"
}

License

The package is available as open source under the terms of the MIT License.

Keywords

FAQs

Package last updated on 29 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc