{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":5096,"path":"conversational-interfaces/virtual-agent/oauth-setup-apple.md","title":"OAuth setup for Apple Messages for Business","bundle":null,"doc_type":null,"release":"australia","body":"\n# OAuth setup for Apple Messages for Business\n\nIntegrate your Identity Provider \\(IdP\\) with Apple Messages for Business using OAuth2 authentication.\n\n## Connect Apple Messages for Business to your ServiceNow® instance\n\nComplete the following steps on the Apple Messages for Business site to connect your Apple Messages for Business account to your ServiceNow® instance.\n\n1.  Go to the Apple Messages for Business page \\(register.apple.com\\) and log in to your Messages for Business account.\n2.  Go to the **Integrated OAuth2 Authentication** section.\n3.  Add the Authorization URL from your Identity Provider \\(IdP\\) to the **OAuth URL** field.\n4.  Add the Token URL from your IdP to the **Token URL** field.\n5.  Add the Client ID from your IdP to the **Client Identifier** field.\n6.  Refer to the [Apple documentation](https://register.apple.com/resources/messages/msp-rest-api/type-interactive#authentication-message) for further instructions on configuring OAuth2 authentication on your Apple Messages for Business account.\n\n## Set up OAuth on your ServiceNow® instance\n\n1.  Go to your ServiceNow® instance to set up OAuth.\n2.  Create a new record in the Application Registries \\(oauth\\_entity\\) table using these instructions: [Use a third-party OAuth provider](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/web-services/t_UseAThirdPartyOAuthProvider.md).\n    -   Use the grant type **Authorization code**.\n    -   Add the **Token URL**.\n3.  Create a new record in the OAuth Entity Scopes \\(oauth\\_entity\\_scope\\) table using these instructions: [Specify an OAuth scope](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/api-reference/web-services/t_SpecifyAnOAuthScope.md). If you have multiple scopes, then add a new record for each scope, and create a corresponding Entity Profile Scope record for each scope.\n4.  Create a new record in the Connection and Credential Aliases \\(sys\\_alias\\) table using these instructions: [Create a Connection &amp; Credential alias](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/connection-alias.md). This connection alias is used for fetching the http connection record which you create in the next step.\n5.  Create a new record in the HTTP\\(s\\) Connection \\(http\\_connection\\) table using these instructions: [Create an HTTP\\(s\\) connection](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/create-https-connection.md).\n    -   Type of connection - Select HTTP\\(s\\) Connection\n    -   Set the Connection alias to the `sys_alias` record created in previous step.\n\n    -   Set the connection url to fetch the user information API as per your IdP. \\(For example:`https://<your-idp-app>.com/api/v1/users`\\)\n6.  Create a Profile Parser Action using Workflow Studio. See the code snippets shown here for an example: [Create a profile parser action for Apple Messages for Business](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/conversational-interfaces/virtual-agent/create-profile-parser-action-apple.md). See [Building actions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/build-workflows/actions.md) for more details.\n7.  Create a new record in the Provider Application Authentications \\(sys\\_cs\\_provider\\_app\\_authentication\\) table using these instructions:\n    -   Set the Provider Channel Identity to your provider app \\(`sys_cs_provider_application`\\)\n    -   Set the OAuth Entity Profile to the `oauth_entity_profile` record created with your OAuth Provider \\(`oauth_entity`\\) record.\n    -   Set the Profile API Connection to the `http_connection` record created previously.\n\n    -   Set the Profile Response Parser Action to the `sys_hub_action_type_definition` record that you have defined.\n\n"}}