Skip to content

SenseMap Login on a Local Environment

RedayY edited this page Jun 25, 2018 · 4 revisions

SenseMap Login

This Wiki Page will explain and demonstrate how to prepare the Login to test on a Local Environment


For a Video Demonstration and Tutorial please follow this Link: Video

Getting Client ID and Redirect URI

  1. Visit Google Developers API Console and Register for their services.
  2. Click on Library on the left sideboard and Scroll down to Google Social API's and select Google+ API
  3. Enable the Google+ Social API by registering and clicking on ENABLE.
  4. On the left sideboard click on Credentials
  5. On the Top Navigation bar you will be able to see the following : Credentials | Oauth Consent Screen | Domain Verification
  6. Choose Oauth Consent Screen and add in a Name and fill out the remaining Required fields (they only ask for basic information such as Name and email)
  7. Save this and click on Credentials on the top Navigation
  8. Click on the Create New Credentials button
  9. Select Create Client ID on the drop down menu
  10. As for application type we will have to select Web application.
  11. Give a random name (irrelevant)
  12. For Authorised JavaScript origins we do NOT have to fill that out so please ignore
  13. Authorised redirect URIs is what we need. For that we need to reference our local background.html (history map page of SenseMap). Since were loading the application locally, Our Path to that page is unique per machine. This will not be the case when the Application is hosted on the Chrome Web Store.
  14. To Find your Application ID for SenseMap running locally, go to chrome://extensions and click on SenseMap. On there you will see a field called ID. It will look like this ID Example.
  15. Run chrome.identity.getRedirectURL("src/background/backgroud.html") in Chrome console
  16. It should look like this https://lajblbdkejaddpihfeeihnicfkmiojem/src/background/backgroud.html. (Please note the ID for you would be different)
  17. Add this new URL to your Authorised redirect URI's list.
  18. Copy the Client ID on the top of the PAGE and click on save.

Adding the Generated Information to SenseMap

  1. On the SenseMap/src/js Source Location you will find a folder called /login.
  2. In that folder you will find a file called "initHelloOauth.js"
  3. Open that file and replace the Client ID with your Local ID and the redirect URI with your redirect URI.
  4. Save that file.
  5. Open Manifest.JSON and replace on line 53 the CLIENT ID with your Client ID.

Save, exit reload the extension and the Login should work for you locally.

Please Note : All of the above is not required for you to do, this is only a tutorial with the purpose for you to set it up from scratch. You could also let me know ur Application ID for SenseMap on your machine and I can whitelist ur URI to access the login. Once it is whitelisted the only thing you need to do is to replace the Application ID in the redirect URI in "initHelloOauth.js" with your id and then it should work.

Thank you for reading and watching :)

Clone this wiki locally