Skip to content

Commit e93b245

Browse files
committed
docs: explain how to get credentials from Apple
1 parent 3a61e10 commit e93b245

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

docs/basic-usage/getting-credentials-from-apple.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,42 @@ title: Getting credentials from Apple
33
weight: 1
44
---
55

6-
Coming soon...
6+
In order to generate passes for Apple Wallet, you first need to request a certificate from Apple. This certificate is used to sign the passes you generate.
77

8+
To request a certificate, you or your organisation must be a member of the [Apple Developer Program](https://developer.apple.com/programs/enroll).
9+
10+
First, follow [Apple's guide](https://developer.apple.com/help/account/certificates/create-a-certificate-signing-request/) to generate a CSR (Certificate Signing Request) file.
11+
12+
Then, follow these steps to request a certificate from Apple:
13+
14+
1. Head to [Certificates, Identifiers & Profiles](https://developer.apple.com/account/resources/identifiers/list) in the Apple Developer portal and select Identifiers.
15+
16+
2. Click the `+` button to create a new identifier.
17+
18+
3. Select **Pass Type IDs** and click Continue.
19+
20+
4. Provide a description for your key, and an identifier. It's recommended to use a reverse domain name notation, like `pass.be.spatie`. Then click Register.
21+
22+
5. Select your new Pass Type ID from the list. Under **Production Certificates**, select "Create Certificate".
23+
24+
6. Provide the CSR file you generated earlier and click Continue.
25+
26+
7. Now click Download to download the certificate, and double-click it to install it in Keychain Access.
27+
28+
8. Export your keys to a `.p12` file. Open Keychain Access and search for your certificate by the identifier you provided earlier. Expand the item to reveal the private key, then select both items. Right-click the items and select Export. Choose a password and save the file.
29+
30+
![Exporting the certificate](/images/exporting-key.gif)
31+
32+
You can now set the `mobile-pass.apple.certificate_path` config variable to point to this `.p12` file, or by setting the `MOBILE_PASS_APPLE_CERTIFICATE_PATH` environment variable.
33+
34+
You must also set the `mobile-pass.apple.certificate_password` config variable to the password you set when exporting the certificate, or by setting the `MOBILE_PASS_APPLE_CERTIFICATE_PASSWORD` environment variable.
35+
36+
If you prefer, you can use the base64 encoded contents of your `.p12` certificate rather than the path of the file.
37+
38+
```bash
39+
base64 -i path/to/certificate.p12 | pbcopy
40+
```
41+
42+
Then set the `mobile-pass.apple.certificate` config variable to the base64 encoded contents, or by setting the `MOBILE_PASS_APPLE_CERTIFICATE` environment variable.
43+
44+
Remember, the key and its contents as well as the certificate password are sensitive information. Keep them safe.

docs/images/exporting-key.gif

2.92 MB
Loading

0 commit comments

Comments
 (0)