Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@exoshtw/apple-auth-backend
Advanced tools
Readme
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 18 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.