The AirMap Authentication JS Module allows developers to easily add authentication to their web app. The Auth module provides a Lock user interface that allows users to login to AirMap, which is required to interact with certain APIs.
You must have an AirMap Developer account to use the AirMap Auth module. If you do not have an account, sign up for one at the AirMap Developer Portal.
To use the AirMap Auth module, a
client_id must be generated when creating your application and obtaining in the Developer Portal. Additionally, a
callback_url must be provided to AirMap in order to whitelist the use of the module. The Developer Portal provides a config file that contains all of the required information to conveniently place in your app (see example below).
The Auth module is open-source and available from a variety of sources:
<!-- Latest patch release --> <script src="https://cdn.airmap.io/js/auth/1.3.2/airmap-auth.min.js"></script> <!-- Latest minor release --> <script src="https://cdn.airmap.io/js/auth/v1.3/index.min.js"></script>
bower install airmap-auth
npm install airmap-auth
After installing the airmap-auth module, you'll need bundle it up along with all of its dependencies using a tool like webpack or browserify. If you don't have a build process in place for managing dependencies, it is recommended that you use the module via bower or the CDN.
An example of the Auth module is included in the Github repository.
- Clone the repo and run
- Visit the AirMap Developer Portal and ensure the Callback URL is set in the Auth0 section (for this example, we are using
https://localhost:8080/). Adding a Callback URL will allow you to generate an Auth0 Client ID.
- Copy the Config JSON object and paste into
npm startin the root directory and navigate to
Updated 12 months ago