Understanding the OAuth Flow of a Cisco Spark Integration


  • Sign up for Cisco Spark - take a tour!
  • Register a new custom Spark 'integration' type application with Cisco
  • Walk-through a sample application demonstrating how to authenticate with the Spark OAuth2 API from a browser-based JavaScript application

Download the complete sample code project for this lab on GitHub.com CiscoDevNet/spark-auth-sample


Cisco Spark is a cloud service providing persistent chat, room-based collaboration, WebRTC video conferencing, and more. Developers can easily integrate solutions with Spark via the Spark REST API - for example to add Spark messaging features to an app user interface, or to automate sending Spark messages to rooms based on business system or real-world events.

Screen Shot

Application developers integrating with Spark that wish to use OAuth/SSO for authenticating user and performing API requests on their behalf must register their app via the Cisco Spark for Developers portal - defining the application name, permissions, and OAuth2 redirect URL (more on this later). During registration, the system generates a Client ID and Client Secret pair, which are later used by the application to access the Spark OAuth2 authentication service. During this lab, you will create a new custom app registration, and generate a Client ID and Secret.

Finally, we will examine a small sample HTML/JavaScript application that demonstrates how to perform a Spark OAuth2 authentication. We'll walk through some of the key concepts and code details, then use the app to generate a Spark API access token.

Note, if your application does not need to 'impersonate' end users, and will only be performing Spark API calls on its own behalf, you may want to create a Spark 'bot' and use its access token, rather than implementing OAuth.

Step 1: Sign up for Cisco Spark and take a tour

If you already have a Spark account, skip to Step 2

  1. From the Spark home page at https://web.ciscospark.com enter your email address, and follow the instructions for creating a Spark account. Note: you will need to access your email account, as Spark will send a 'You have a Cisco Spark account' email message with a 'Create Password' verification link - this must be completed in order to login to Spark.

    Cisco Spark homepage (link)

  2. Log in to Spark and take a quick look around. Feel free to create a new room and invite a friend (note: they will need to complete the email verification step, too.)

  3. For more information on Spark features and benefits, check out http://www.webex.com/ciscospark/