Skip to content

Commit

Permalink
add oauth module
Browse files Browse the repository at this point in the history
  • Loading branch information
tonisives committed Nov 8, 2023
1 parent a9ab8d2 commit 88f8519
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 208 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ Network Trash Folder
Temporary Items
.apdisk

*credentials.xml
*credentials.xml
build
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Basic OAuth

This sample app for Android uses the OAuth API of High-Mobility to have car access granted by the
owner. The OAuth flow is described in detail on https://high-mobility.com/learn/documentation/cloud-api/oauth2/intro/
owner. The OAuth flow is described in detail on https://docs.high-mobility.com/guides/platform/oauth2-client-credentials/

# Configuration

Before running the app, make sure to configure the following:

1. in `BasicOAuthActivity.kt`: Initialise HMKit with a valid device certificate from the Developer
Center https://high-mobility.com/develop/
Center https://console.high-mobility.com
2. In the Developer Center, go to the `OAuth2 Client` settings page
3. Copy and insert the Auth URI, Client ID, redirectScheme (URL-scheme for iOS & Android), Token URI,
and an app's Serial # / AppId, into the instance variables of `BasicOAuthActivity.kt`. All of this
Expand Down
16 changes: 5 additions & 11 deletions basic-oauth/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'


android {
compileSdkVersion ver.compileSdk
namespace 'com.highmobility.basicoauth'

buildFeatures {
viewBinding true
}

defaultConfig {
applicationId "com.highmobility.basicoauth"
minSdkVersion 21
Expand All @@ -31,20 +34,11 @@ android {

dependencies {
if (project.hasProperty('depLocation') == false || project.depLocation > 0) {
implementation(deps.hmkit) {
transitive = true
}
implementation(deps.autoApi)
implementation(deps.crypto)
implementation(deps.utils)
} else {
implementation project(path: ':hmkit-android')
implementation project(path: ':hmkit-crypto')
implementation project(path: ':hmkit-utils')
implementation project(path: ':hmkit-auto-api')
}

implementation deps.timber

implementation "com.jakewharton.timber:timber:5.0.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
}
Loading

0 comments on commit 88f8519

Please sign in to comment.