---
title: Incorporating Sign in with Apple into other platforms
framework: signinwithapple
role: article
role_heading: Article
path: signinwithapple/incorporating-sign-in-with-apple-into-other-platforms
---

# Incorporating Sign in with Apple into other platforms

Add Sign in with Apple capabilities to apps that can’t directly access Sign in with Apple JS.

## Overview

Overview To add Sign in with Apple to apps that don’t have access to the Sign in with Apple JS framework, you control the sign-in request manually. Perform this request by adding a custom Sign in with Apple button, sending the required query parameters, handling the return request, and returning control back to the app. Add a custom Sign in with Apple button Apple provides three secure HTTP URLs that generate Sign in with Apple button images corresponding to three modes: center-aligned, left-aligned, and logo only. Entering one of these URLs in a browser triggers the download of the related button image as a PNG file. Use this file to customize and embed your button of choice in your application or service. You can also test and preview custom buttons at Sign in with Apple Button. Customize the button image by adding query parameters to the URL. If you send invalid query parameters to the endpoint URL, the server returns a 404 Page Not Found error. For a center-aligned button, use the secure HTTP URL https://appleid.cdn-apple.com/appleid/button, as in this example: curl --get "https://appleid.cdn-apple.com/appleid/button" \ -H 'content-type: application/json; charset=UTF-8' \ -d 'height=HEIGHT' \ -d 'width=WIDTH' \ -d 'color=COLOR' \ -d 'border=BORDER' \ -d 'type=TYPE' \ -d 'border_radius=BORDER_RADIUS' \ -d 'scale=SCALE' \ -d 'locale=LOCALE' \ -o FILENAME You can customize the button with the following attributes: For a left-aligned button, use the secure HTTP URL https://appleid.cdn-apple.com/appleid/button/left, as in this example: curl --get "https://appleid.cdn-apple.com/appleid/button/left" \ -H 'content-type: application/json; charset=UTF-8' \ -d 'height=HEIGHT' \ -d 'width=WIDTH' \ -d 'color=COLOR' \ -d 'border=BORDER' \ -d 'type=TYPE' \ -d 'border_radius=BORDER_RADIUS' \ -d 'scale=SCALE' \ -d 'locale=LOCALE' \ -o FILENAME You can customize the button using the same attributes you use for customizing a center-aligned button, shown above, and the following attributes: For a button with the Apple logo only, use the secure HTTP URL https://appleid.cdn-apple.com/appleid/button/logo, as in this example: curl --get "https://appleid.cdn-apple.com/appleid/button/logo" \ -H 'content-type: application/json; charset=UTF-8' \ -d 'label-position=LABEL_POSITION' \ -d 'logo-position=LOGO_POSITION' \ -d 'logo-size=LOGO_SIZE' \ -o FILENAME You can customize the logo button with the following attributes: When the user clicks any of these button types, open a browser tab with the authorization URL and the authorization query parameters. Send the required query parameters Direct the authorization request using the HTTP GET method to the URL https://appleid.apple.com/auth/authorize, as in this example: curl --get "https://appleid.apple.com/auth/authorize" \ -H 'content-type: application/json; charset=UTF-8' \ -d 'client_id=CLIENT_ID' \ -d 'redirect_uri=REDIRECT_URI' \ -d 'response_type=RESPONSE_TYPE' \ -d 'scope=SCOPE' \ -d 'response_mode=RESPONSE_MODE' \ -d 'state=STATE' \ -d 'nonce=NONCE' The URL contains the following parameters: If the response contains an error, see ErrorResponse for the specific error code provided in the response body. You can also visit Sign in with Apple button to view and adjust live previews of web-based buttons and get the code. Handle the response When the Sign in with Apple UI appears in the opened browser tab, the user can sign in and accept any terms and conditions for your app. After Apple processes the authorization request, the handling of the response depends on the value in response_mode: For the query value, the response parameters are added to the redirectURI value as query parameters, and the browser is redirected to the resulting value. For the fragment value, the response parameters are added to the redirectURI value as a fragment, and the browser is redirected. For the form_post value, an HTTP POST request containing the results of the authorization is sent to the redirectURI. The HTTP body contains the result parameters with application/x-www-form-urlencoded content type. A successful response may contain the following parameters: You receive a secure HTTP POST response in which the values returned are dependent on the query parameters used in the request. Use the state, response_type, and scope parameters to control what data is returned. The response is similar to the following example which contains all possible fields: {   "code": "cbc78...faa325",   "id_token": "eyJhb...Ii6uA",   "state": "ebd019c2-a2d6-4e89-872a-1acab4f851ea",   "user": {     "name": {       "firstName": "Maria",       "lastName": "Ruiz"     },     "email": "ep9ks2tnph@privaterelay.appleid.com"   } } If an error occurs, the HTTP body contains the following parameters: note: The only error code that might be returned is user_cancelled_authorize. This error code is returned if the user clicks Cancel during the web flow. Return control to the app At the end of the authorization flow, Apple performs a form_post to the redirect_uri value you provided. At this point, the authorization flow is complete, and it’s your server’s responsibility to persist the data and return control to the app. Platforms that support custom URL schemes — iOS 12.0 and earlier and Android — must handle the data resulting from the authorization flow by storing it on their app server in the logic of their redirect_uri endpoint. You then redirect the custom URL scheme to give control back to the app. Get a Sign in with Apple button Use the following API endpoints to create a custom Sign in with Apple button: Get a Sign in with Apple button that is center-aligned. Get a Sign in with Apple button that is left-aligned. Get a Sign in with Apple button that contains just the Apple logo.

## See Also

### Related Documentation

- [Sign in with Apple JS](signinwithapplejs.md)
- [Sign in with Apple REST API](signinwithapplerestapi.md)
