iCloud Authentication
iCloud authentication requires an app-specific password. This is a requirement from Apple.
Learn More
Learn more about setting up app passwords in Nylas.
Prerequisites
- Read our guide on Hosted Authentication.
- Read our guide on Native Authentication.
iCloud Hosted Authentication Steps
- Have your user generate an app-specific password. They’ll need it to continue on.
- Redirect the user to the Nylas hosted login page by making a GET request to /oauth/authorize.
- Once they are directed to the Nylas hosted login page, instead of using the iCloud password, they use the app-specific password.
- Complete the authentication flow by getting access tokens based on the
response_type
.
iCloud Native Authentication Steps
-
Have your user generate an app-specific password.
-
Create a branded page as you normally would.
-
Make a request to /connect/authorize and provide the app-specific password in the settings. An example request is shown below:
curl -X POST https://api.nylas.com/connect/authorize -d '{
"client_id": "nylas_client_id",
"name": "Nyla the Cheetah",
"email_address": "[email protected]",
"provider": "icloud",
"settings": {
"password": "app-specific-password"
},
"scopes": "email.read_only,calendar.read_only,contacts.read_only"
}' -
Exchange the code as you normally would.