https://github.com/maxschmeling/apple-id-client-secret
Create client secret JWT for Apple ID
https://github.com/maxschmeling/apple-id-client-secret
Last synced: about 1 year ago
JSON representation
Create client secret JWT for Apple ID
- Host: GitHub
- URL: https://github.com/maxschmeling/apple-id-client-secret
- Owner: maxschmeling
- License: mit
- Created: 2020-07-07T22:26:53.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2023-01-06T10:57:21.000Z (over 3 years ago)
- Last Synced: 2025-03-28T05:51:03.225Z (about 1 year ago)
- Language: TypeScript
- Size: 990 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Apple ID Client Secret
The Apple ID REST API for exchanging authorization codes or refresh tokens for access tokens requires a client secret in the form of a signed JWT. This simple library will generate the signed JWT using minimal configuration.
Implementation based on [Generate and Validate Tokens](https://developer.apple.com/documentation/sign_in_with_apple/generate_and_validate_tokens) documentation from Apple and built using the [jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken) package from Auth0.
## Install
```bash
$ npm install apple-id-client-secret
```
or
```bash
$ yarn add apple-id-client-secret
```
## Usage
```typescript
import { createClientSecret } from "apple-id-client-secret"
const clientSecret: string = createClientSecret({
keyId: "{key ID from Apple}",
bundleId: "com.example",
teamId: "{team ID frmo Apple}",
privateKey: `-----BEGIN PRIVATE KEY-----
{your}
{private}
{key}
-----END PRIVATE KEY-----`;
});
```
## License
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.