
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@exoshtw/apple-auth-backend
Advanced tools
Library for sign in with Apple to use from server-side.
import fs from 'fs';
import path from 'path';
import {getAuthToken} from '@exoshtw/node-apple-signin';
export function loginApple(code) {
const response = await getAuthToken(code, {
clientId: '....',
teamId: '....',
keyId: '...',
key: fs.readFileSync(path.join(__dirname, 'private_key.p8')),
});
console.log(response);
// {
// access_token: '...',
// token_type: 'Bearer',
// expires_in: 3600,
// refresh_token: '...',
// id_token: '{encoded_jwt_reponse}',
// data: { // <- decoded id_token
// iss: 'https://appleid.apple.com',
// aud: '...',
// exp: 1582046751,
// iat: 1582046151,
// sub: '...',
// at_hash: '...',
// email: '...',
// email_verified: 'true',
// auth_time: 1582046132
// }
// }
}
Get actual timestamp in int32 format.
Generate the JWT signed token for apple auth
Name | Type | Argument | Description |
---|---|---|---|
options | object | Options | |
options.timestamp | int | optional | Timestamp, autogenerated by default |
options.expire | int | optional | Expiration time of token |
options.clientId | string | Apple client id | |
options.teamId | string | Apple team id | |
options.keyId | string | Private key id |
Get the auth token to signing with back code
Name | Type | Argument | Description |
---|---|---|---|
code | string | Code returned from client app | |
options | object | Options | |
options.timestamp | int | optional | Timestamp, autogenerated by default |
options.expire | int | optional | Expiration time of token |
options.clientId | string | Apple client id | |
options.teamId | string | Apple team id | |
options.keyId | string | Private key id |
There are other greats libraries (listed bellow) to use with node, but are focused on generating a sign in url and to work with a callback url.
This library is focused on working from the server-side, for example, to use Apple signin from mobile applications.
FAQs
Logging with Apple
The npm package @exoshtw/apple-auth-backend receives a total of 28 weekly downloads. As such, @exoshtw/apple-auth-backend popularity was classified as not popular.
We found that @exoshtw/apple-auth-backend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.