From 88b6982b2df96019c01f73ffb573d442991ffceb Mon Sep 17 00:00:00 2001 From: EricJ Date: Tue, 1 May 2018 14:49:03 -0700 Subject: [PATCH] Changes to token instructions Changes to token instructions, including sidebar nav adjustment --- app_setup.md | 29 ---------------------- documents.json | 10 +++----- grant_type.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++ index.md | 21 ++++++++++------ 4 files changed, 82 insertions(+), 44 deletions(-) delete mode 100644 app_setup.md mode change 100644 => 100755 documents.json create mode 100644 grant_type.md mode change 100644 => 100755 index.md diff --git a/app_setup.md b/app_setup.md deleted file mode 100644 index 9b0577f..0000000 --- a/app_setup.md +++ /dev/null @@ -1,29 +0,0 @@ - -# Register Your App # - -## Authentication ## -Some endpoints require an authorized user in order to make API calls. Many of the API calls require an authorized user to be associated with the SDK requests. After a user successfully logs in, a Token object will be returned that contains a token id, which must be sent in all subsequent HTTP request headers in the field "MojioAPIToken". - -Tokens have an expiry date which you are able to set or extend. - - -# Set up Your App # -Before you can access the APIs, you have to register an app with Mojio. Registering an app gives you a _Client Id_ and a _Secret Key_ which is required for authentication. - -You will need a Mojio account in order to use the Mojio APIs. To obtain a Mojio ID, please... - -To set up an app: - -* Browse to [https://docs.moj.io/#/myapp/](https://docs.moj.io/#/myapp/) -* If you are not logged in, you will be prompted to do so -* Give your new app a name and click "Create" -* Your app should now show up in the apps list -* Click on the key icon to get your app credentials -* Click on the pencil icon to set your redirect url (explained below) - -# User Authentication # - -See the [Authentication page](https://docs.moj.io/#!/document/view/doc_auth) for full instructions on authentication. - - - diff --git a/documents.json b/documents.json old mode 100644 new mode 100755 index 9598220..055e840 --- a/documents.json +++ b/documents.json @@ -4,21 +4,17 @@ "file":"index", "submenu": [ { - "title":"Register your App", - "file":"app_setup" + "title":"Choose Your Grant Type", + "file":"grant_type" }, { "title": "Authentication", "file":"doc_auth" }, { - "title":"APIs Overview", + "title":"About Our APIs", "file":"doc_apis" }, - { - "title":"Getting Help", - "file" : "getting_help" - } ] }, { diff --git a/grant_type.md b/grant_type.md new file mode 100644 index 0000000..55dd5c0 --- /dev/null +++ b/grant_type.md @@ -0,0 +1,66 @@ + +# Chooase Your Grant Type # + +## Which Grant Type to Use? ## + +Before you register your app and obtain authentication credentials, you need to decide whether to use implicit or authorization code to generate your access token. + +Which is best for you? + +### Implicit grant ### + +If you have a “single page application” (e.g., an application running in a browser using a scripting language such as Javascript), then the implicit grant should be used. In this case, instead of getting an authorization code that needs to be exchanged for an access token, you would retrieve an access token directly. Although this is more efficient since it reduces the number of round trips required to get an access token, it is not secure because the access token is exposed on the client side. In other words, implicit grant does not return refresh tokens because the browser generally cannot keep them private. Mojio implicit grant tokens expire in 12 hours; after this, users have to log in again. + +### Authorization code grant #### + +If you have a regular web app executing on a server, then the authorization code grant is the flow you should use to retrieve an authorization token and, optionally, a refresh token. This is considered the safest choice since the authorization token is passed directly to the web server hosting the application without going through the user's web browser and risking exposure. Mojio refresh tokens are good for a month; once expired, your developers can generate a new token without users needing to log in again. + +## How to Generate a Grant Token ## + +Here is the code snippet to use to generate a token: + + +### IMPLICIT ### + +{ +"Description": "string", +"Name": "string", +"AllowedGrantTypes": [ +"implicit" +], +"RedirectUris": [ +"string" +] +} + +### AUTHORIZATION CODE ### +{ +"Description": "string", +"Name": "string", +"AllowedGrantTypes": [ +"authorization_code", +“refresh_token” +], +"RedirectUris": [ +"string" +] +} + +**NOTE: Your redirect URIs must use HTTPs** + +## Next Steps ## + +To generate the code yourself: + ++ Click the API link above, from the sidebar, click **Apps**, then **POST** for **/v2/apps**.(or, if you’re logged in, go to https://docs.moj.io/#!/api/detail/REST/~2Fv2~2Fapps/post) ++ If sample code is not shown in the Value box under Parameters, click the far right icon. ++ In the snippet, change the values as needed and click **Execute**. + +Once that is done, proceed to the [authentication instructions page](https://docs.moj.io/#!/document/view/doc_auth). + + + + + + + diff --git a/index.md b/index.md old mode 100644 new mode 100755 index d5b75c6..c74a52b --- a/index.md +++ b/index.md @@ -1,17 +1,22 @@ -# Getting Started # +# Get Started # -Welcome to Mojio! This page will help get you on your way to connecting to the Mojio Connected Device Platform. +Welcome to Mojio! -The Mojio Connected Device Platform is the leading open platform for securely accessing and interacting with connected devices. Using a telematic control unit (TCU) connected to an asset, the platform retrieves, parses, and delivers a valuable array of telemetry data and information to the Mojio Motion app on a user’s mobile device or approved third-party app. +This site will help get you on your way to connecting to the Mojio platform via our APIs. -Mojio officially supports _iOS_, _Android_, _.Net_ and _JavaScript_ and has SDKs for each of these environments. If you do not use one of these environments, as long as your choice of development tools support open technologies such as _HTTPS_, _REST_ and _WebSockets_, you will be able to integrate with Mojio. +Mojio officially supports _iOS_, _Android_, _.Net_ and _JavaScript_ and has SDKs for each of these environments. If you do not use one of these environments, as long as your choice of development tools supports open technologies such as _HTTPS_, _REST_ and _WebSockets_, you will be able to integrate with Mojio. -# Some Basic Ground Rules # +## Some Basic Ground Rules ## -Mojio gives you access to a great deal of data from its connected devices. Our hope is that you will create apps and services to improve the experience of your users. We ask that you respect the user, their overall app experience, and safeguard their privacy. +Mojio gives you access to a great deal of data about drivers and their vehicles. Our hope is that you will create apps and services to improve the end user experience and that you respect end users and safeguard their privacy. -As well, for developers creating integrations with our connected car devices, please note that driving while distracted is now a leading cause of accidents. Please keep this in mind with any solution you are developing and ensure that you do not distract the user when their focus should be on the road. +Driving while distracted is now a leading cause of accidents. We are building the connected car to improve the overall user experience on the road. Please do so with safety in mind. Unlike other apps, Mojio apps know when drivers are behind the wheel. Please take extra care in ensuring that you do not distract users when their focus should be on the road. + +Finally, we want to help you build great apps. If there is anything we can do to make it easier to build car connected apps, please reach out to the Mojio team. + +## Next Steps ## + +If you're just getting started and ready to get going, it's time to Choose Your Grant Type. -Finally, we want to help you build great apps. If there is anything we can do to make it easier to build connected device apps, please reach out to the Mojio team.