Skip to content

Examples of how to use the smart-me oauth authorization

Notifications You must be signed in to change notification settings

eCarUp/smart-me-api-oauth-examples

Repository files navigation

smart-me OAuth Samples

Supported Grants (Flows)

Name Use case
Authorization Code Cloud Application with a Backend
Authorization Code with PKCE Public Application like a web app or an App without a Backend
Device Code IoT Device with a Display
Client Credentials IoT Device without a Display

URLs

Name Url
Base Url https://api.smart-me.com
Authorization /oauth/authorize
Token /oauth/token
Device Code /oauth/device

Samples

Authorization Code with PKCE (.net Maui Example)

Flow

  1. App makes an auth request and shows the login page

    image

  2. User accept that this app can access to the smart-me data

image

  1. The register deeplink (mysampleapp://callback/ in the sample) is called and the access and refresh token is returned.

Setup

Create oAuth Application

  1. Go to https://www.smart-me.com and login with your smart-me Account
  2. Go to the API Settings and create an "Public" OAuth Application. As redirect URL choose the deep link defined in the Maui App

image

Device Code

The device code can be used to give a IoT Device access to the smart-me Api. This without the need to enter and store the username and password on the device.

Flow

  1. Device makes an authorize call to /oauth/device

  2. The device shows the device code on the screen (e.g. 0648-9465-6349)

  3. The user goes to https://api.smart-me.com/oauth/verify

  4. The user logs in with his smart-me account:

    image

  5. The user enters the code from the device

    image

  6. The user accecpt that the device will has access to his data:

    image

  7. The device gets the Access Token and can use that for the API

Setup

Create oAuth Application

  1. Go to https://www.smart-me.com and login with your smart-me Account
  2. Go to the API Settings and create an "Public" OAuth Application image
  3. Copy the ClientId into your device firmware

About

Examples of how to use the smart-me oauth authorization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages