# Patent

## Title
Email notification system

## Abstract

Examples described herein include systems and methods for providing push notifications to a third-party application executing on a client device. An example can include encrypting user credentials, generating a callback Uniform Resource Locator (“URL”) with at least a portion of the encrypted credentials embedded into the URL, and requesting notifications from an email service to be provided at the callback URL. Upon receiving a notification at the callback URL, a system component can decrypt the credentials within the URL using a private key and log into the email account using those decrypted credentials. The system component can then generate a push notification based on any changes found in the email account and cause the notification to be delivered to the third-party application on the client device.

## Background
CROSS REFERENCE TO RELATED APPLICATIONS
This application is a continuation in part of each of U.S. application Ser. No. 15/867,586 (entitled “EMAIL NOTIFICATION SYSTEM,” filed Jan. 10, 2018), Ser. No. 15/867,590 (entitled “EMAIL NOTIFICATION SYSTEM,” filed Jan. 10, 2018), and Ser. No. 15/867,597 (entitled “EMAIL NOTIFICATION SYSTEM,” filed Jan. 10, 2018), all of which are expressly incorporated herein by reference.


BACKGROUND
Push notifications provide timely notifications to users without requiring the receiving device to connect to a server and request a status update. Push notifications save battery life for the receiving device, as connecting to a server takes more processing power than simply receiving the pushed notification. In the case of email communication, notifications can be pushed from a backend service that monitors a user's email inbox and detects incoming email messages.
The backend services that support push notifications are typically designed to support native applications, such as a native email client, that can interact with and take advantage of operating-system features. Complications arise when using third-party applications that cannot take advantage of certain operating-system features, and therefore do not receive push notifications in the traditional manner. These complications compound when an enterprise implements an Enterprise Mobility Management (“EMM”) or Mobile Device Management (“MDM”) system, where the EMM provider can be managing thousands of email accounts across multiple different systems, servers, and backends. Today's operating systems simply cannot accommodate push notifications in that scenario.
EMM providers can work around the problems above by directly accessing users' email accounts to monitor changes and then send notifications as desired. However, doing so requires an EMM provider to either utilize a service account with authority to access multiple users' accounts, or store email credentials for each of the user accounts. Both of these approaches can create security concerns, as the users' credentials are susceptible to being stolen by anyone with sufficient access to the EMM provider's system.
As a result, a need exists for systems and methods that allow an EMM provider to access user email accounts and coordinate push notifications without the EMM provider storing credentials for the email accounts that could allow hackers to gain access.
SUMMARY
Examples described herein include systems and methods for providing push notifications to a third-party application executing on a client device. In a first example, a notification server receives a request from a client device. The request can include a user identification associated with the user, such as a hash of an email address associated with the user of the client device or the email address itself. The request can also include user credentials encrypted with a public key. The credentials can be associated with the user's email account at an email service. In one example, the request also includes a push-notification-service token that can be provided to a push notification service in order to deliver notifications to the device.
This example method can also include generating a callback Uniform Resource Locator (“URL”). The callback URL can include at least a portion of encrypted user credentials within the URL. The notification server can instruct the email service to contact the callback URL to report a change in the email account. The change could be a new email or it could be an alert, such as a password-expiration warning. In response to receiving contact at the callback URL, the notification server can decrypt the embedded encrypted user credentials using a private key corresponding to the public key used to encrypt the credentials.
In response to the email service contacting the notification server at the callback URL, the notification server can fetch email information from the email service. Fetching the email information can include, for example, accessing the email service using decrypted user credentials obtained by decrypting the encrypted user credentials embedded in the callback URL.
The method can also include causing a push notification to be transmitted to the client device. The push notification can include at least a portion of the fetched email information, such as a subject line and a sender, and potentially a portion of the email body as well. The notification server can push the notification directly to the device in some examples, while in other examples the notification server can instruct a push notification service to transmit the push notification. The instruction can include providing a push-notification-service token to the push notification service.
A second example method focuses on the operations of the client device. The method can include requesting registration at a notification server and providing a user identification. The method can also include receiving a public key from the notification server. The public key can be part of a private-public key pairing. The private key can be stored at the notification server and associated with the user identification.
The client device can use the public key to encrypt user credentials associated with an email service. The credentials can be a username and password pairing, a certificate, or a token, such as an OAuth token. The device can then transmit the encrypted credentials to the notification server. Those encrypted credentials can be decrypted by the notification server to provide the server with access to the email service. At least a portion of the encrypted credentials can be embedded into a callback URL generated by the notification server. The server can instruct the email service to access the callback URL in response to a change in an email folder associated with the user, such as when a new email is received.
The method can also include receiving, at the client device, a notification in response to the email service accessing the callback URL. The notification can be delivered directly from the notification server, or it can be delivered by an intermediary server that receives the notification from the notification server. The client device can access the email service in response to receiving the notification.
A third example method focuses on interactions between a notification server and an email server of an email service. The method can include generating a callback URL that includes at least a portion of a user's email credentials in encrypted form. As mentioned above, the credentials can include a username and password pairing, a certificate, or a token. The method can also include requesting that the email server provide notifications for the user's email account. The request can specify that notifications for the user's email account be provided at the callback URL.
The method can include receiving a notification from the email service at the callback URL. The callback URL can include a user identification that allows the notification server to identify a private key associated with the user. The private key can be used to decrypt the encrypted credentials embedded in the callback URL. After decrypting the credentials, the notification server can fetch email information from the email service using the decrypted credentials. The unencrypted credentials can be deleted from the notification server after fetching the email information.
The notification server can generate a device notification based on the fetched email information and transmit it to the user's device. The notification can include at least a portion of the fetched email information, such as a subject line and sender of a newly received email. In some examples, the notification server can instruct another server or service to generate and/or send the notification.
A fourth example method focuses on generating a callback URL, and particularly on circumstances where the callback URL or user credential exceeds a threshold length. For example, the method can include generating a callback URL that includes only a first portion of the encrypted user credentials. A second portion can be stored on the notification server so that the full credentials can be assembled by the notification server when the first portion is received on callback from the email service. By storing less than the full credentials on the notification server, security risks can be avoided.
In one example, the method can include determining that the length of the callback URL exceeds a threshold length, such as 2000 characters. Based on the length exceeding the threshold, the method can include removing multiple characters from the encrypted user credentials and generating a filler key that includes the removed characters. The method can include replacing the encrypted user credentials in the callback URL with the filler key. The method can also include storing a decryption key configured to decrypt the filler key.
Removing multiple characters from the encrypted user credentials can be performed based on a jump size that specifies a number of characters following a removed character that are not to be removed. For a jump size of three, for example, the three characters following a removed character would not be removed. The removed characters can be combined to form a filler key. Either the removed characters or the remaining characters can be stored at the notification server, and the other portion of the credentials can be included in the callback URL and deleted from the notification server.
The method can include replacing the encrypted user credentials in the callback URL with the filler key. An indication of the jump size can be included in the callback URL. An identification of the user can also be included in the callback URL. The identification can map to a private key that can be used to decrypt the encrypted credentials. The unremoved characters can be grouped together to form a broken payload that is stored for later use during the decryption process.
The examples summarized above can each be incorporated into a non-transitory, computer-readable medium having instructions that, when executed by a processor associated with a computing device, cause the processor to perform the stages described. Additionally, the example methods summarized above can each be implemented in a system including, for example, a memory storage and a computing device having a processor that executes instructions to carry out the stages described.
Both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the examples, as claimed.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a flowchart of an exemplary method performed by a server for providing push notifications to a client device using a callback URL.
FIG. 2 is a flowchart of an exemplary method performed by a client device for registering the client device into a notification service for receiving push notifications.
FIG. 3 is a flowchart of an exemplary method performed by a notification server for subscribing to an email service for receiving email updates at a callback URL.
FIG. 4 is a flowchart of an exemplary method for providing push notifications to a client device.
FIG. 5 is a flowchart of an exemplary method for registering a client device into a notification service for receiving push notifications.
FIG. 6 is a flowchart of an exemplary method for unregistering a client device from a notification service for receiving push notifications.
FIG. 7 is a flowchart of an exemplary method for handling token changes for a client device receiving push notifications.
FIG. 8 is a flowchart of an exemplary method for handing credential changes for a client device receiving push notifications.
FIG. 9 is a flowchart of an exemplary method for retrieving email information and sending a push notification to a client device.
FIG. 10 is a flowchart of an exemplary method for shortening a callback URL.
FIG. 11 is a flowchart of an exemplary method for shortening a callback URL.
FIG. 12 is an example depiction of shortening a callback URL.
FIG. 13 is an illustration of example system components for providing push notifications to client devices.



DESCRIPTION OF THE EXAMPLES
Reference will now be made in detail to the present examples, including examples illustrated in the accompanying drawings. Wherever possible, the same references' numbers will be used throughout the drawings to refer to the same or like parts.
Examples described herein include systems and methods for providing push notifications to a third-party application executing on a client device. The client device can interact with a notification server to securely provide credentials for a user's email account. The notification server can use the credentials to subscribe to the email account and request updates regarding any changes to the account, such as a newly received email, to be provided at a callback URL. The callback URL can include an encrypted version of the user's credentials and an identification of the user. The notification server can select an appropriate decryption key based on the user identification and use it to decrypt the credentials embedded in the callback URL. The decrypted credentials can be used to log in to the user's email account and retrieve any necessary information to be provided in a notification to the client device. In situations where the callback URL or encrypted credentials exceed an allowable length, the notification server can provide a shortened callback URL that contains only part of the user credentials using methods described herein.
FIG. 1 provides a high-level flowchart including interactions between a notification server and a client device and email service. FIG. 2 provides a flowchart including more detailed interactions between the client device and the notification server, while FIG. 3 provides a flowchart including interactions between the notification server and the email service. FIG. 4 provides a flowchart of the overall process including additional details. The process of registering a device to receive push notifications from the notification server is detailed in FIG. 5, while the process of unregistering is covered by FIG. 6. FIG. 7 relates to a process for handling token changes when the client device authenticates to the email service with a token. FIG. 8 similarly relates to a process for handling credential changes. FIG. 9 provides a flowchart for handling a change notification received at the notification server from the email service. FIGS. 10 and 11 relate to example methods for shortening a callback URL, while FIG. 12 shows details of an example shortening of a callback URL. FIG. 13 provides an illustration of system components for accomplishing the various methods disclosed herein.
FIG. 1 provides a flowchart of a high-level example method executed by a notification server. At stage 110 of the method, the notification server can receive a request from a client device. The request can be sent from the client device and can originate from an application executing on the client device. In one example, the application is a third-party email client, such as VMWARE's BOXER application. The request can indicate that the device is requesting to receive notifications, such as email notifications, through the notification server. The request can include identification information that allows the notification server to identify a particular account, such as an email account. For example, it can include a user ID, an email address, a hash of an email address, or some other form of identification.
The request can also include user credentials associated with an email account of the user. The credentials can be a username and password combination for the email account in some examples. The credentials can also include a certificate or a token, such as an OAuth token, for accessing the user's email account. Regardless of their type, the user's credentials can be encrypted with a public key provided by the notification server.
At stage 120, the notification service executing on the notification server can generate a callback URL. The callback URL can indicate the address of the notification server or service, so that the email server can communicate with the notification service. The callback URL can also include at least a portion of the encrypted user credentials embedded within the URL. In some examples, the entirety of the encrypted user credentials is embedded into the URL. The processes of generating and utilizing the callback URL are described in more detail in conjunction with various other figures, such as FIGS. 4, 5, and 9-12.
At stage 130, the notification service can instruct the email service to contact the callback URL in the event of a change in the user's email account. To gain access to the email service, the notification service can decrypt the encrypted credentials using a private key corresponding to the public key used for encryption. In this way, neither the email service nor the notification service maintains the full credentials in readable form.
The notification service can request contact from the email service in the event of a change to the user's email account, including, for example, a new email, read receipt, or meeting invitation received at the email account, an email being removed from the account or moved to a different subfolder, or any other similar type of change. The change could also be an alert that requires badging at the user device. For example, the email service can indicate a number to be displayed on an application icon associated with the email client on the user's device. The number can indicate a number of unread message, for example. The email service can be configured to access the callback URL in response to detecting any change in the user's email account. The notification server can take further actions at that point, as described in more detail with respect to FIGS. 3, 4, and 9.
Turning to FIG. 2, various steps of an example method are depicted in a flowchart. Stage 210 can include requesting registration with a notification server. The request can be sent from the client device, as explained previously. The request can include identification information that allows the notification server to identify a particular account, such as an email account. For example, it can include a user ID, an email address, a hash of an email address, or some other form of identification. The user identification can be sent from the client device to the notification server at stage 220.
At stage 230, the client device receives a public key from the notification server. The public key can be part of a public-private key pairing. For example, the notification server can generate a key pair where the public key is used for encryption and the private key, which differs from the public key, is used for decryption of information encrypted with the matching public key. The keys can be generated at the notification server. While the public key is provided to the client device at stage 230, the private key can be stored at a secure location accessible only to the notification server.
At stage 240, the client device can use the public key to encrypt user credentials for accessing an account, such as an email account, identified at stage 220. For example, the client device can encrypt a username and password combination for the email account. In some examples, the client device can alternatively, or additionally, encrypt other credentials. For example, the device can encrypt a certificate or a token, such as an OAuth token, for accessing the account. The encrypted credentials can be transmitted to the notification server at stage 250. The notification server can use the encrypted credentials and user identification to generate a callback URL. The processes of generating and utilizing the callback URL are described in more detail in conjunction with various other figures, such as FIGS. 4, 5, and 9-12.
At stage 260, the client device receives a notification, such as an email notification from the notification server. An email notification can include any information relevant to a user's email account, such as an indication that a new email, read receipt, or meeting invitation was received. The notification can also include additional information about the indication, such as a subject line, portion of the body of an email, or key details from a meeting invitation. The notification server performs various tasks in order to deliver the notification to the client device, and these tasks are described later in this disclosure, such as in conjunction with FIG. 9. After receiving the notification, the client device can access the email service directly and download the email, read receipt, meeting invitation.
FIG. 3 provides a flowchart depicting an example method of providing push notifications to a client device. The example method of FIG. 3 begins after the notification server has received encrypted credentials from a client device, along with a user identification associated with the credentials. At stage 310 of the method, the notification server can generate a callback URL. The callback URL can be generated by selecting a URL associated with the notification server and embedding a user identification and at least a portion of the encrypted credentials into the URL.
For example, the notification server can initially select a URL such as https://notifications.vmware.com/api. In some examples, the selected URL contains fields that need to be completed in order for the URL to be fully functional. For example, a user identification field such as “id=x” can be included in the URL. Similarly, a credential field such as “c=y” can be included in the URL. The example URL containing these fields can read: https://notifications.vmware.com/api?id=x&c=y. To complete the generation of the URL for a particular user, the notification server can substitute a user identification for “x” and substitute encrypted credentials for “y”. An example of the resulting callback URL using a user identification of “12345” and an encrypted credential of “012345ABCDEF” would therefore read: https://notifications.vmware.com/api?id=12345&c=012345ABCDEF.
At stage 320, the notification server can request notifications from an email service at the callback URL. To do so, the notification server can decrypt the encrypted credentials received from the client device using a private key. The private key can correspond to the use of the client device, as discussed with respect to FIG. 2. After obtaining the decrypted credentials, the notification server can access the email service using those credentials and request notifications at the callback URL. For example, the notification server can use an Application Programming Interface (“API”) call or another access method, such as a webhook, to instruct the email service to send a change notification in the event of any changes to the user's email folder. These changes can include, for example, receiving a new email, read receipt, or meeting invitation, removing an email from a folder, moving an email from one subfolder to another, or any other change. The email service can be configured to access the callback URL in response to detecting any change in the user's email account.
At stage 330, the notification server receives a change notification at the callback URL. The change notification can indicate a change to the user's email folder. The change notification itself need not include an explanation or indication of that type of change; rather, the change notification can simply provide a notification that some change has been made. In some examples, however, the change notification can include a description of the type of change, for example by including an indication of a new email in the change notification.
At stage 340, the notification can decrypt the credentials embedded in the callback URL. This stage can include extracting user identification information from the callback URL. For example, if the callback URL includes a user identification portion, such as “id=1234,” the notification server can determine that the user identification is “1234.” The notification server can then cross-reference this identification with a table that identifies a private key corresponding to user “1234.” The table can be stored at the notification server or at another storage location, such as an external database accessible to the notification server. The notification server can retrieve the private key corresponding to the user identification information and use the private key to decrypt the credentials embedded in the callback URL.
Having decrypted the credentials in the callback URL using the appropriate private key, the notification server can then fetch email information from the email service at stage 350. For example, the notification server can gain access to the user's email account by providing the unencrypted credentials to the email service. The notification server can then determine what change, or changes, prompted the change notification from the email service. These changes can then be captured and provided to the user by sending a notification to the client device, as discussed in more detail below in conjunction with FIG. 4.
FIG. 4 provides a flowchart of an example method of providing push notifications that includes additional details. The flowchart shows interactions between an email client executing on a client device, an Email Notification System (“ENS”) server (also referred to as a “notification server” throughout this disclosure), and an email server.
Stage 410 of the method includes the email client sending a registration request to the ENS server. The registration request can include an API token for authenticating with the API of the ENS server. For example, the API token can be sent as a header parameter on outgoing connections from the client device. The API token can be distributed to a client device from a management server, in some examples. The management server can be part of an EMM system and determine whether the client device is compliant with any relevant compliance rules and policies before issuing the API token.
The management server can also provide an API key to the ENS server for authenticating a matching API token. The ENS server can store a table of API keys that is checked against a whitelist of authorized API keys. If a client device falls out of compliance, the management server can remove the corresponding API key from the whitelist. In that example, when the non-compliant device attempts to access the ENS server, the API authentication will fail and the ENS server will not communicate with the client device. In some examples, API keys are set to expire after a predetermined amount of time, at which point the ENS server needs to refresh the API key statuses. The management server can refresh the statuses by sending a new whitelist, sending updates to the whitelist, or confirming that an existing whitelist is correct. The request at stage 410 can also include a user identification, such as an email hash, email address, or user ID number.
If the API token sent by the client device is authorized by the ENS server, then at stage 415 the ENS server can generate a public-private key pairing. A unique key pairing is generated for each user. The public key provides information sufficient to encrypt data, but does not provide information for decrypting that data. As a result, interception of the public key does not threaten data security. The private key can be stored at the ENS server, thereby avoiding a transmission of the private key, which could be susceptible to unwanted interception.
The public key can be provided to the email client at stage 420. The private key can be stored in a table kept by the ENS server. The table can include various fields, such as a user identification field, a public key field, a private key field, a subscription field indicating whether the device is subscribed for push notifications, and other fields discussed later.
At stage 425, the email client can cause the user's email credentials to be encrypted using the public key. The encrypted credentials can be transmitted to the ENS server at stage 430. Stage 430 can also include sending a user identification as well as the API token, depending upon the settings at the ENS server. This stage can also include sending a notification-service token. The notification-service token is described in more detail later, but generally acts to authenticate a particular application and a particular device to a push notification service (also referred to herein as a “notification service”). The push notification service can be used later in the method when the ENS server wishes to send a push notification remotely to the client device.
Having received the encrypted credentials at stage 430, the ENS server can look up the user in the stored table using either the user identification, API token, or both. The ENS server can then identify the private key stored in the table for that user and use the private key to decrypt the encrypted credentials at stage 435.
Stage 440 can include generating a callback URL in the manner described previously, including embedding at least a portion of a user identification and at least a portion of the encrypted credentials into the callback URL. Stage 440 can occur before, during, or after stage 435. For example, the ENS server can decrypt the credentials at stage 435 after generating the callback URL at stage 440, and then use the decrypted credentials in stage 445.
At stage 445, the ENS server can subscribe to the email server. This stage can include discovering the email server endpoint based on the credentials provided by the email client. For example, the ENS server can auto-discover the email service based on the domain portion of the user's email account. The ENS can also identify the email service based on an indication of a version, such as an EXCHANGE version, received from the client device for auto-discovery of the email service. The ENS server can subscribe to the email server using a webhook link that contains the encrypted credentials. The webhook can be a ENS-server-defined HTTP callback that is triggered by a change in an email folder associated with an email account and stored by the email server. At stage 450, the ENS server can define the HTTP callback to be the callback URL generated at stage 440.
At stage 455, the ENS server can delete the unencrypted user credentials from the server as a security measure. This stage can also include deleting the encrypted user credentials extracted from the callback URL. No user credentials would persist on the server at that time. If a third party were to hack the ENS server and extract its information, they would not be able to capture any user credentials—one of the goals of the subject matter described herein.
At stage 460, the email server determines that a change has occurred in the email folder of the user's email account, and accordingly makes an HTTP request at the callback URL associated with that account. The request is received by the ENS server at the callback URL. The ENS server extracts a user identification from the callback URL, as well as the encrypted credentials embedded in the URL. The ENS server can use the user identification to look up the user in a stored table and obtain the corresponding private key for decrypting the credentials. At stage 465, the ENS server can decrypt the credentials using the private key.
At stage 470, the ENS server can use the credentials to access the user's email account at the email server. For example, the ENS server can use a different encryption format to encrypt the user's credentials when forming a request to access the user's email account. The email server can receive the user's credentials, decrypt them according to a predetermined decryption scheme, and then grant access based on the credentials. The ENS server can then delete the credentials again at stage 472. This can include deleting the unencrypted credentials as well as any versions of the encrypted credentials. In some examples, this stage is performed directly after sending the request for email details at stage 470. This prevents the credentials from being stored at the ENS server.
Email details, such as information regarding a newly received email, can be transmitted at stage 475. The ENS server can determine whether a notification should be pushed to the client device based on the email details. For example, if the email details simply indicate that an email has been deleted, the ENS server can choose not to generate a push notification. On the other hand, if a new email has been received and appears to not be spam, the ENS server can generate a notification.
At stage 480, a push notification is transmitted to the email client. In some examples, the ENS server can push the notification directly to the device. In other examples, the ENS server can use a notification service, such as the APPLE NOTIFICATION SERVICE (“APNS”). The notification service can be a server, or network of servers, provided by an OEM and configured to deliver notifications to specific applications on specific devices. The notification service can utilize notification-service tokens, such as APNS tokens, to authenticate the applications and devices. The notification service can be selected by the notification server based on the device type of the user device running the email client, in an example.
In some examples, the notification service only authorizes certain providers to generate push notifications. For example, a provider can be required to provide requests in a particular format, encrypt the requests in a particular manner, and include a notification-service certificate or token with the requests. In some examples, the ENS server can act as an authorized provider that can utilize the notification service. In other examples, the ENS server provides the request to an intermediary server, such as a cloud notification server, that is authorized as a provider. A system having these components is illustrated in FIG. 13. Stage 480 can therefore include pushing a notification directly from the ENS server to the client device, instructing a notification service to push the notification, or instructing an intermediary server to instruct a notifications service to push the notification.
FIG. 5 provides a flowchart of an example method for registration of a client device with a notification server, such as the ENS server of FIG. 4. The method begins stage 520, where the client device obtains an API token. The API token can be provided to the client device from a management server that monitors and confirms device compliance. In some examples, the API token is provided to the notification server which then sends the token to the client device. In other examples, the API token is provisioned directly to the client device from the management server.
Stage 530 includes obtaining a public key at the client device. This stage can include sending an API call to the notification server to obtain the public key. The API call can include a user identification, such as an email address, email hash, or user identification number. The notification server can create a new record, in a table or other database, for the user identification. The notification server can also generate a public-private key pairing and include those keys as entries in the table or database associated with the user identification. The notification server can then respond to the request by providing the public key to the client device.
At stage 540, the client device encrypts the user's email credentials. The client device can use the public key to perform the encryption, as described previously. At stage 550, the client device requests registration with the notification server. The request can be an API call that includes various fields. For example, the request can include a user identification field, which can be an email hash. The request can also include the full email address to assist the notification server in auto-discovering the associated email service.
The request can also include a credentials field. The credentials field can include the encrypted credentials, the public key, a notification-service token, or some combination thereof. The request can also include an application ID that identifies the particular application, such as a third-party email client, making the request. The request can also include an email-server-version field that indicates a version of an email server associated with the email account, such as an EXCHANGE version. The request can further include a force field that, if utilized, can force the server to perform registration even if the requesting client was already registered. Finally, the request can include a sound field that includes a sound name to be returned back with the notification payload and that instructs an application to produce a certain sound in association with the notification.
At stage 560, the notification server can determine whether the requesting client device is the first device to be associated with the requesting user. For example, a user might install a third-party email client on two devices. If the first device has already performed registration with the notification server, then the registration process can end because the registration would be duplicative for the second device. In that example, the method can end at stage 580. The notification service can push the same notifications to multiple devices without further registration since the notification service is already subscribed to the email service for that user.
If, however, the requesting device is the user's first device to request registration, then the method can continue to stage 570. At stage 570, the notification server can subscribe to the email service. This process can include generating a callback URL and establishing a webhook link that defines an HTTP callback for the email service (and that particular user's email account) to be the callback URL, as described above with respect to stages 440-450 of FIG. 4. After the subscription is established for that user and client device, the method can end.
FIG. 6 is a flowchart of an example method for unregistering a client device from a notification server. A user can unregister a client device by, for example, deleting their email account information from an email client executing on a device. As another example, the user can be unregistered if the device is redistributed to another employee of an enterprise. In yet another example, the user can be unregistered if a management server that monitors compliance determines that the device is no longer compliant and restricts the device. In all of these potential scenarios, the notification server should not continue to send notifications to that device. Instead, the method of FIG. 6 can be implemented.
The method begins at stage 620, where the user unregisters from the device as explained above. The client device can post an API call to the notification server requesting to unregister at stage 630. The request to unregister can include a user identification, such as an email hash string or identification number, as well as a notification-service token. The notification-service token can be encrypted with the public key described previously.
At stage 640, the notification server can search for the record associated with the user identification and remove the device from the list of associated devices. The record can be updated to reflect the unregistered state of the device. At stage 650, if the user remains registered with the notification server through other client devices, the notification server can preserve the record and end the process. If, however, no other devices remain registered with the notification server, then at stage 660 the notification server can unregister the subscription with the email service. This can include, for example, deleting the webhook link established for the email service. After unregistering the subscription, the de-registration process can end.
FIG. 7 flowchart of an example method for handling notification-service token changes for a client device receiving push notifications. As mentioned above, a notification service can require a notification-service token in order to provide push notifications to a client device. For example, APPLE's notification service, APNS, requires an APNS token. From time to time, these tokens can change or expire. The example method of FIG. 7 relates to updating the records at the notification server to reflect the new notification-service token.
At stage 720, a notification-service token associated with the client device changes. The change can be a result of the token expiring or the notification service otherwise requiring a change. At stage 730, the client device can request an update by posting an API call to the notification server. The API call can include a user identification along with both the old notification-service token and new notification-service token, both of which can be encrypted with the public key previously provided by the notification server.
At stage 740, the notification server can locate a record associated with the user identification. The old notification-service token can be located and replaced with the new notification-service token. The new notification-service token will then be included in future requests from the notification server to the notification service (or to an intermediary server that forwards the request to the notification service).
While notification-service tokens can be changed, a user's email credentials can similarly change from time to time, for various reasons. For example, some email services require a user to select a new password after a predetermined time period of using the same password. In other examples, a user may elect to change their password for security reasons or because the password was discovered by another party. When a user is registered for notifications from a notification server and the user's credentials change, the notification server can no longer retrieve email information and generate notifications. FIG. 8 focuses on a process for updating the email credentials to continue uninterrupted notification service.
At stage 820, an account credential change is detected on the client device. The credential change can be detected by the email client, such as by detecting when a user edits the settings of the email client to reflect a new username or password. The email client can also initiate the change itself, by enforcing a time limit on passwords or by carrying out instructions from a management server for initiating a password change. The email client can also receive an indication from the email service that the old password no longer works, and thereby prompt the user for a new password.
At stage 830, the client device can request a credential update at the notification server by accessing an API of the notification server. The request can include a user identification, such as an email hash string, an email address that the notification server can use for auto-discovery of the corresponding email service, and encrypted versions of the username and new password. An encrypted version of the notification-service token can also be provided. The encrypted items can be encrypted with a public key as described previously.
At stage 840, the notification server can unregister the email-service subscription for the user corresponding to the user identification. For example, the notification server can remove the webhook at the email server pointing to the callback URL. The notification server can then re-register the subscription, using the new credentials, at stage 850. This can include setting a new webhook at the email server that points to a new callback URL. The new callback URL can include the new credentials in encrypted format embedded into the URL. At stage 860, the notification server can update a record stored at the database to reflect the updated user credentials.
FIG. 9 provides a flowchart of an example method for handing a change notification received at a notification server. The example method presumes that the notification server has subscribed to a particular email account on behalf of a user. At stage 920, the change notification is received at the notification server. Receiving the change notification can include, for example, receiving a communication at a callback URL. The callback URL can be specified by a webhook set at the email server that instructs the email server to send a communication to the callback URL in the event of a change in the user's email account folder.
Having received the communication at the callback URL, at stage 930 the notification server can extract a user identification and encrypted credentials from the callback URL. In one example, the callback URL includes separate fields dedicated to the user identification and encrypted credentials, respectively. The notification server can use the user identification to locate a record corresponding to the user and stored in a database. At stage 940, the notification server can obtain information from the located record, such as a private key for decryption and a notification-service token to be used for configuring a notification service. The private key can then be applied to decrypt the encrypted credentials.
At stage 950, the notification server can use the decrypted user credentials to fetch new email information from the email service. This stage can involve accessing the email service and providing decrypted user credentials to gain access to the user's email account. The notification server can compare the state of the user's email account to a previous state, detecting any changes such as new messages, deleted messages, receiving meeting invitations, and so on. The notification server can then determine whether the detected changes are a type of change that should prompt a push notification. For example, a deleted email need not prompt a push notification, while a newly received email should result in a push notification.
At stage 960, the notification server can cause a push notification to be sent to the client device. In some examples, the notification server can push the notification directly to the device. In other examples, it can utilize a notification service, such as APNS, the deliver the push notification to the device. If the notification service only authorizes certain providers to generate push notifications, the notification server can utilize an intermediary server with access rights to the notification service. For example, the notification server can deliver instructions to a cloud notification server with access rights to a notification service, and the cloud notification server can instruct the notification service to push the notification to the device. The process can then end and the device is free to contact the email service directly to retrieve the new email or otherwise update its email information on the client device.
Various examples above describe embedding encrypted credentials into a callback URL. However, URLs have character limits, and sometimes encrypted credentials can cause a callback URL to exceed the available character limit. For example, some email servers, such as EXCHANGE servers, enforce a 2000-character limit on URLs set to be used as callbacks. This limit can be exceeded when, for example, the credentials include one or more tokens or certificates. A token (such as an OAuth token) or certificate can include more characters than a typical username and password combination. The encrypted form of a token or certificate can therefore extend the callback URL beyond an allowed length. FIG. 10 provides an example method for overcoming this problem.
At stage 1010 of the method of FIG. 10, the user credentials can be encrypted. The encryption can occur at the client device, which then delivers the encrypted credentials to a notification server. In another example, the notification server can encrypt the credentials itself. In either case, the encrypted credentials are provided at or by the notification server at stage 1010.
At stage 1020, the notification server can generate a callback URL that includes the encrypted credentials embedded within the URL, as discussed previously. The stage can also include determining whether the length of the callback URL would exceed a length threshold. The length threshold can correspond to a technical limit, such as the maximum URL length. But the length threshold can also be set at the notification server to be any specific limit. For example, the limit may be set to an amount lower than the maximum workable amount in order to save space or computing power when handling the callback URL. The determination can also be based on the type credential. For example, where an OAuth token is required, the notification server can determine that the maximum length threshold would be exceeded.
At stage 1030, if the length exceeds the threshold length, the notification server can remove characters from the encrypted user credentials. The characters can be removed according to a predetermined scheme as described in more detail with respect to FIGS. 11 and 12. At stage 1040, the notification server can generate a filler key that includes the removed characters. The filler key can be substantially shorter than the encrypted user credentials. The number of characters within the filler key can be set as a variable at the notification server in advance. In general, the notification server can provide a first portion of the encrypted user credentials in the callback URL but store a second portion that together make up the complete encrypted credentials.
At stage 1050, the notification server can use the filler key as the encrypted credentials in the callback URL. This can include replacing the encrypted credentials in the callback URL with the filler key if the completed callback URL had too many characters. In one example, the notification server can reconstruct the user credentials upon callback by injecting the filler key data into the second stored portion to generate the full encrypted user credentials. Then the private key can be used to decrypt the assembled encrypted user credentials. In another example, the filler key cannot be decrypted using only the private key stored at the notification server, as the private key corresponds to the full encrypted credentials. As a result, the notification server can store a new key at stage 1060 for decrypting the filler key. The new key can include information sufficient to generate the full encrypted credentials based on the filler key. For example, it can include the characters of the encrypted credentials that were omitted from the filler key and an indication of how to recreate the encrypted credentials from the filler key and the omitted characters. This process is discussed more below.
FIG. 11 provides a more detailed flowchart of shortening a callback URL as discussed in FIG. 10. At stage 1110, a payload for the callback URL is generated. At this stage of the process, the payload can simply be the encrypted credentials. At stage 1115, a filler key size is input for the callback URL. The filler key size can be a standard size, such as five characters in one example. The filler key size can be modified for each callback URL, as desired.
At stage 1120, a determination is made as to whether the callback URL does or would exceed a length threshold, as described previously. If the length of the callback URL is less than the threshold, then the process can continue to stage 1125, where it is determined that no shortening, or “chunking,” is required. However, if the length of the callback URL is greater than the threshold, the process continues to stage 1130.
At stage 1130, a jump size can be established. The jump size can indicate which characters in the encrypted-credential portion of the callback URL will be used for a filler key and which characters will be placed into a broken payload. In one example, the jump size indicates the number of character in between the characters selected for the filler key. For example, if the jump size is four, the process will select the fifth character, tenth character (with four unselected characters in between), fifteenth character (again with four unselected characters in between), and so on.
The jump size can be calculated based on the length of the callback URL and the filler key size. For example, if the callback URL is 3000 characters, the embedded credentials are 2900 characters, and the filler key size is 50, then the jump size will be calculated such that 50 characters are removed from the 2900-character encrypted credentials. In that example, the jump size can be calculated to be 57 characters. In other words, for every 58 characters of the encrypted credentials, one character is selected for the filler key. This process repeats 50times to encompass all 2900 characters. The resulting filler key will be 50 characters, making the overall callback URL 150 characters instead of 3000 characters. The jump size can be calculated by dividing the number of characters in the non-shortened encrypted credentials by the filler key size, and then subtracting one from the result.
Stage 1135 of the method can include extracting one character every jump size, as describe in the example above. It can also include combining the extracted characters to build a filler key. The non-extracted characters can also be combined to form a broken payload, which can be used for decryption purposes at later stages of the method.
At stage 1140, several key parameters are output. Specifically, the jump size, filler key, and broken payload are output. The broken payload does not go into the modified callback URL, and is therefore saved to the database at stage 1155. The filler key and jump size are inserted into the callback URL at stage 1145. An example of this is provided in FIG. 12 and discussed below. In an alternate example, the filler key and jump size can be stored at the notification server, and the broken payload can be inserted into the callback URL.
At stage 1150, the notification server can subscribe to the email service using the modified callback URL. The subscription process is similar to the subscription processes described above, with one difference being that the modified callback URL is used for the webhook set at the email server. If the subscription fails, a response is sent to the client device at stage 1160. If the subscription is successful, the information associated with the modified callback URL (such as the jump size, filler key, and broken payload) are saved to the database at stage 1155, and a response is sent to the client device at stage 1160.
When the notification receives a call from the email server at the modified callback URL, it can retrieve the jump size and broken payload associated with the filler key embedded in the modified callback URL. The jump size and broken payload can be used, in conjunction with the filler key, to reconstruct the un-modified encrypted credentials. Those encrypted credentials can then be decrypted with the private key to retrieve unencrypted credentials that can be used to access the associated user's email account.
FIG. 12 provides an example illustration of the shortening process described above with respect to FIGS. 10 and 11. Element 1210 includes an original callback URL that includes, among other things, a user-identification field 1215 and an encrypted-credential field 1220. Although the length of the callback URL 1210 is short enough to avoid the need for shortening, it is used here merely for example purposes. The input parameters are provided at element 1225. In this example, the parameters include a filler key size of 5 and a payload that mirrors the encrypted credentials in field 1220 of the original callback URL.
Element 1230 depicts the chunking or shortening of the payload based on the filler key size. Element 1230 includes a jump size, which as explained previously, can be calculated by dividing the length of the payload (20) with the filler key size (five), and then subtracting one from the result (four) to obtain a jump size of three (20/5−1=3). Element 1230 also shows the jump size in action, as the first three characters are skipped, the fourth character is selected, the next three characters are skipped, and so on, until five characters are selected for the filler key.
Element 1235 depicts the example output of this process, with the filler key corresponding to the five extracted characters, an indication of the jump size, and the broken payload which comprises the unselected characters from the payload. The final URL, shown at element 1240, includes the filler key 1245 and jump size 1250 in lieu of the unmodified encrypted credentials 1220. The user identification field 1215 remains. The example of FIG. 12 is merely one way that shortening can occur and is provided merely as a non-limiting example of such a process.
FIG. 13 depicts a system with components for performing the various methods, process, and stages described above. The system can include a client device at 1310. The client device 1310 can be any type of computing device, such as a phone, tablet, watch, laptop, or desktop computer. The client device 1310 can include a processor and memory storage. It can also communicate via a network, such as the internet, in wired or wireless fashion, using one or more components associated with the device. The client device 1310 can include or more email clients, include one or more third-party email clients that are not developed by the device manufacturer. An example of such an email client is VMWARE's BOXER application.
The client device 1310 can communicate with a notification server 1320 as described above. The notification server 1320 can be a single server or a network of servers that include one or more processors and memory storage locations. The notification server 1320 can also include one or more databases that are accessible to the notification server 1320.
The client device 1310 can also communicate with an email service 1330. For example, an email client on the device 1310 can access the email service 1330. The email service 1330 can include one or more physical hardware servers that store email information for the user's email account. For example, the one or more servers can include a username and password, a database storing the emails associated with the user's account, and various settings for the account. These settings can include a webhook, established by the notification server 1320, defining a callback URL at which the email service 1330 can provide change notifications. In one example, the email service is a MICROSOFT EXCHANGE server, a MICROSOFT EXCHANGE WEB SERVICES server, or a combination of both. The email service 1330 can deliver emails directly to the device 1310. In some examples, the email service 1330 stores new emails until the device 1310 reaches out to the service 1330 to request an email synchronization, at which point new emails can be transmitted to the device 1310.
A push notification service 1350 can be utilized for pushing notifications to the client device 1310. The notification service 1350 can be a server, or network of servers, provided by an OEM and configured to deliver notifications to specific applications on specific devices 1310. An example notification service 1350 is APNS (APPLE NOTIFICATION SERVICE). The notification service 1350 can utilize notification-service tokens, such as APNS tokens, to authenticate the applications and devices.
In some examples, the notification service 1350 only authorizes certain providers to generate push notifications. For example, a provider can be required to provide requests in a particular format, encrypt the requests in a particular manner, and include a notification-service certificate or token with the requests. The provider can also be required to include provider-specific authentication credentials in order to utilize the service 1350. In some examples, the notification server 1320 can act as an authorized provider and utilize the notification service 1350.
In other examples, however, the notification server 1320 is not an authorized provider and can therefore utilize an intermediary server, such as the cloud notification server 1340 of FIG. 13. The cloud notification server 1340 can be a single server or a network of multiple servers with permission to send notification requests through the push notification service 1350. In some examples, the cloud notification server 1340 is controlled by an EMM provider that also controls the notification server 1320. A push notification can therefore be routed from the notification server 1320 to the cloud notification server 1340, which then routes the notification to the push notification service 1350. The push notification service 1350 can authenticate both the cloud notification server 1340 and the particular client device 1310 (and email client executing on the client device 1310) before pushing the notification to the device 1310.
Other examples of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the examples disclosed herein. Though some of the described methods have been presented as a series of steps, it should be appreciated that one or more steps can occur simultaneously, in an overlapping fashion, or in a different order. The order of steps presented are only illustrative of the possibilities and those steps can be executed or performed in any suitable fashion. Moreover, the various features of the examples described here are not mutually exclusive. Rather, any feature of any example described here can be incorporated into any other suitable example. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

## Claims

1. A method for generating a shortened callback Uniform Resource Locator (URL), comprising:
providing an original callback URL comprising a user-identification field and an encrypted-credential field;
removing a plurality of characters from the encrypted-credential field;
generating a filler key comprising the removed plurality of characters;
generating the shortened callback URL, the shortened callback URL specifying a URL that comprises the filler key; and
storing a decryption key.

2. The method of claim 1, wherein the removed characters are removed based on a jump size, the jump size specifying a number of characters following a removed character that are not to be removed.

3. The method of claim 2, wherein an indication of the jump size is included in the shortened callback URL.

4. The method of claim 1, wherein a remaining plurality of unremoved characters is combined to form a broken payload.

5. The method of claim 4, further comprising storing the broken payload.

6. The method of claim 1, wherein the shortened callback URL comprises an identification associated with a particular user.

7. The method of claim 1, wherein the shortened callback URL comprises a field identifying the decryption key associated with the encrypted-credential field.

8. A non-transitory, computer-readable medium comprising instructions that, when executed by a processor of a computing device, perform stages for generating a shortened callback Uniform Resource Locator (URL), the stages comprising:
providing an original callback URL comprising a user-identification field and an encrypted-credential field;
removing a plurality of characters from the encrypted-credential field;
generating a filler key comprising the removed plurality of characters;
generating the shortened callback URL, the shortened callback URL specifying a URL that comprises the filler key; and
storing a decryption key.

9. The non-transitory, computer-readable medium of claim 8, wherein the removed characters are removed based on a jump size, the jump size specifying a number of characters following a removed character that are not to be removed.

10. The non-transitory, computer-readable medium of claim 8, wherein an indication of the jump size is included in the shortened callback URL.

11. The non-transitory, computer-readable medium of claim 8, wherein a remaining plurality of unremoved characters is combined to form a broken payload.

12. The non-transitory, computer-readable medium of claim 11, the stages further comprising storing the broken payload.

13. The non-transitory, computer-readable medium of claim 8, wherein the shortened callback URL comprises an identification associated with a particular user.

14. The non-transitory, computer-readable medium of claim 8, wherein the shortened callback URL comprises a field identifying the decryption key associated with the encrypted-credential field.

15. A system for generating a shortened callback Uniform Resource Locator (URL), comprising:
a memory storage including a non-transitory, computer-readable medium comprising instructions; and
a computing device including a processor that executes the instructions to carry out stages comprising:
providing an original callback URL comprising a user-identification field and an encrypted-credential field;
removing a plurality of characters from the encrypted-credential field;
generating a filler key comprising the removed plurality of characters;
generating the shortened callback URL, the shortened callback URL specifying a URL that comprises the filler key; and
storing a decryption key.

16. The system of claim 15, wherein the removed characters are removed based on a jump size, the jump size specifying a number of characters following a removed character that are not to be removed.

17. The system of claim 15, wherein an indication of the jump size is included in the shortened callback URL.

18. The system of claim 15, wherein a remaining plurality of unremoved characters is combined to form a broken payload.

19. The system of claim 15, wherein the shortened callback URL comprises an identification associated with a particular user.

20. The system of claim 15, wherein the shortened callback URL comprises a field identifying the decryption key associated with the encrypted-credential field.