Win $20,000. Help build the future of education. Answer the call. Learn more

Authenticate and personalize a financial news portal

Note: This code pattern uses Watson Discovery V1, and will not work with Discovery V2. However, you can still use it to learn the Discovery features. Future plans include updating the code pattern to work with Discovery V2.


In any application, authentication and personalization are important aspects. This code pattern demonstrates how authentication with social login and user personalization can be added to any app using IBM Cloud® App ID.


There are two important aspects for any app that you build: authentication and personalization. Support for social login is now common for online platform authentication. Users can log into an online portal using their Google or Facebook social media accounts, which is beneficial for both them and the portals. It is not necessary for someone to create a separate account on every online portal, which leads to increased portal consumption. People increasingly trust the security provided by social media login.

The second aspect is user personalization. Many online portals contain vast amounts of information, but end users are only interested in certain topics. By implementing user personalization, your portal can become more consumable for your audience. For example, if an online news portal contains politics, entertainment, science, technology, sports, and financial stories, a reader who is only interested in sports must scan many articles before reaching one that interests them. Alternatively, user personalization technology can do the filtering for the reader and present only the articles that align with their interests.

In this code pattern, you build an online financial news portal that sources articles from the IBM Watson® Discovery News collection. You add social login and user personalization features from IBM Cloud App ID so that someone can log in using their existing Google or Facebook social media accounts. After logging in, they build a profile specifying their areas of interest, such as equity or mutual funds. Your app filters the news content based on the profile and presents it to the user for consumption.


Architecture flow diagram for authenticating and personalizing a financial news portal

  1. The user accesses the app user interface (UI) rendered by the front-end service.
  2. The app UI sends the request to the front-end service.
  3. The front-end service fetches financial articles from the news service, which sources the articles from Discovery News, and displays them in the app UI.
  4. The user logs into the portal through the front-end service using social login powered by App ID.
  5. The user sets their preferences through the front-end service, which invokes the user management service with the preferences.
  6. The user management service sets the user profile on App ID.
  7. After the user signs in, the front-end service invokes the news service for financial news.
  8. The news service retrieves the user profile and preferences.
  9. The news service returns personalized news sourced from Watson Discovery News based on the user profile.
  10. When a user updates their preferences, the app displays personalized news based on the new preferences.


Find the detailed steps for this code pattern in the file. The steps will show you how to:

  • Add social login to an app with App ID.
  • Build a user profile with App ID.
  • Get financial news from the Discovery News collection using the Discovery Query Language.
  • Add user personalization to filter news articles based on a profile.
  • Deploy the app on Cloud Foundry or Red Hat® OpenShift® on IBM Cloud.