Skip to content

Releases: nexys-system/oauth

v0.3.1

01 Apr 09:43
Compare
Choose a tag to compare

Release Notes for the nexys/oauth package with Apple Sign-In with Apple implementation:

New Features

  • Added AppleSSOClient class for implementing Sign-In with Apple flow using Apple's REST APIs.
  • The AppleSSOClient class extends the AbstractOAuth class and provides the following methods:
    • oAuthUrl: Generates the authorization URL for redirecting the user to Apple's sign-in page.
    • callback: Handles the callback from Apple after the user authorizes the app and exchanges the authorization code for an access token.
    • getProfile: Retrieves the user's profile information from Apple's userInfo endpoint using the access token.

Usage

To use the AppleSSOClient, you'll need to provide the following credentials from your Apple Developer Account:

  • clientId: Your Client ID
  • teamId: Your Team ID
  • keyId: Your Key ID
  • privateKey: Your private key
  • redirectUrl: The redirect URI registered with Apple

Example:

import AppleSSOClient from 'nexys/oauth/apple';

const clientId = 'YOUR_CLIENT_ID';
const teamId = 'YOUR_TEAM_ID';
const keyId = 'YOUR_KEY_ID';
const privateKey = 'YOUR_PRIVATE_KEY';
const redirectUrl = 'YOUR_REDIRECT_URI';

const appleClient = new AppleSSOClient(clientId, teamId, keyId, privateKey, redirectUrl);

// Generate the authorization URL
const authUrl = appleClient.oAuthUrl();
// Redirect the user to the authUrl

// Handle the callback from Apple
const code = 'CODE_FROM_APPLE'; // Get the code from the callback
const tokenResponse = await appleClient.callback(code);
const accessToken = tokenResponse.access_token;

// Get the user's profile information
const profileData = await appleClient.getProfile(accessToken);
console.log('User Profile:', profileData);

Dependencies

  • The AppleSSOClient class depends on the following utilities:
    • AbstractOAuth class from ../abstract.js
    • paramsToQueryString function from ../utils.js
    • secretFromPrivateKey function from ./utils.js

Types

  • The AppleProfile interface defines the shape of the user profile data returned by Apple's userInfo endpoint.
interface AppleProfile {
  name: string;
  email: string;
  sub: string; // unique user id
  email_verified: boolean;
}

Notes

  • The implementation uses the native fetch API for making HTTP requests to Apple's servers.
  • Error handling is included for failed requests, with error messages logged to the console and errors thrown.
  • The AppleSSOClient class is designed to work with the existing AbstractOAuth class and utilities in the nexys/oauth package.

v0.3.0

23 Jan 22:24
Compare
Choose a tag to compare
  • Instagram OAuth Integration: Users can now authenticate using their Instagram credentials. This feature includes support for fetching user profiles and public information.
  • Facebook OAuth Integration: We've also added Facebook authentication, allowing users to log in with their Facebook accounts. The integration supports fetching basic user profile information.

fix zoho

23 Jan 22:12
Compare
Choose a tag to compare

Full Changelog: v0.2.4...v0.2.5

v0.2.4

23 Jan 10:29
e4a3055
Compare
Choose a tag to compare

Full Changelog: v0.2.3...v0.2.4

Microsoft

01 Dec 11:41
4fcd71d
Compare
Choose a tag to compare
v0.1.19

Update package.json

v0.1.17

23 Oct 10:24
31b5d18
Compare
Choose a tag to compare
Update package.json

v0.1.16

23 Oct 10:20
0117aa4
Compare
Choose a tag to compare
swap first and last names

v0.1.13

17 Oct 10:37
7b9c306
Compare
Choose a tag to compare
Update package.json

v0.1.12

17 Oct 10:25
4d587a3
Compare
Choose a tag to compare
0.1.12

zoho with scopes

17 Oct 09:32
ee1cdef
Compare
Choose a tag to compare
v0.1.11

scope as extra param