This repository was archived by the owner on Dec 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Don't expose internal api to end users #108
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a3dc49e
Don't expose internal api to end users
MichielVrins 4f71899
Bump minimum version of flutter sdk to 2.17.0
MichielVrins f64c440
Fix Flutter Linter problems for new Flutter cli version
MichielVrins 802238d
FP-89: Android: Use new 'access' tokenserver
MichielVrins 8a97573
FP-89: Use a different tokenserver
MichielVrins aea528d
Enable dubug logs for android
MichielVrins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 0 additions & 55 deletions
55
example/android/app/src/main/kotlin/com/onegini/mobile/onegini_example/OneginiConfig.kt
This file was deleted.
Oops, something went wrong.
93 changes: 93 additions & 0 deletions
93
...le/android/app/src/main/kotlin/com/onegini/mobile/onegini_example/OneginiConfigModel.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| package com.onegini.mobile.onegini_example; | ||
|
|
||
| import android.os.Build; | ||
| import com.onegini.mobile.onegini_example.R; | ||
| import com.onegini.mobile.sdk.android.model.OneginiClientConfigModel; | ||
|
|
||
| public class OneginiConfigModel implements OneginiClientConfigModel { | ||
|
|
||
| /* Config model generated by SDK Configurator version: v5.1.0 */ | ||
|
|
||
| private final String appIdentifier = "FlutterExampleApp"; | ||
| private final String appPlatform = "android"; | ||
| private final String redirectionUri = "oneginiexample://loginsuccess"; | ||
| private final String appVersion = "1.0.2"; | ||
| private final String baseURL = "https://mobile-security-proxy.test.onegini.com"; | ||
| private final String resourceBaseURL = "https://mobile-security-proxy.test.onegini.com/resources/"; | ||
| private final String keystoreHash = "90cf65bea23977e84dcddfb38b8cecb5469d8ca43aa6b01575864ef2ca6eaa48"; | ||
| private final int maxPinFailures = 3; | ||
| private final String serverPublicKey = "17DDB4086A1D3FA37950CBDDC6F1173A0C5902A3B71DAD261290CEFEE13CC9CA"; | ||
|
|
||
| public String getAppIdentifier() { | ||
| return appIdentifier; | ||
| } | ||
|
|
||
| public String getAppPlatform() { | ||
| return appPlatform; | ||
| } | ||
|
|
||
| public String getRedirectUri() { | ||
| return redirectionUri; | ||
| } | ||
|
|
||
| public String getAppVersion() { | ||
| return appVersion; | ||
| } | ||
|
|
||
| public String getBaseUrl() { | ||
| return baseURL; | ||
| } | ||
|
|
||
| public String getResourceBaseUrl() { | ||
| return resourceBaseURL; | ||
| } | ||
|
|
||
| public int getCertificatePinningKeyStore() { | ||
| return R.raw.keystore; | ||
| } | ||
|
|
||
| public String getKeyStoreHash() { | ||
| return keystoreHash; | ||
| } | ||
|
|
||
| public String getDeviceName() { | ||
| return Build.BRAND + " " + Build.MODEL; | ||
| } | ||
|
|
||
| public String getServerPublicKey() { | ||
| return serverPublicKey; | ||
| } | ||
|
|
||
| /** | ||
| * @Deprecated Since Android SDK 8.0.0 this attribute is not required. | ||
| */ | ||
| public boolean shouldGetIdToken() { | ||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * Get the max PIN failures. This attribute is just used for visual representation towards the end-user. | ||
| * | ||
| * @Deprecated Since Android SDK 6.01.00 this attribute is fetched from the Device config. | ||
| * | ||
| * @return The max PIN failures | ||
| */ | ||
| public int getMaxPinFailures() { | ||
| return maxPinFailures; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return "ConfigModel{" + | ||
| " appIdentifier='" + appIdentifier + "'" + | ||
| ", appPlatform='" + appPlatform + "'" + | ||
| ", redirectionUri='" + redirectionUri + "'" + | ||
| ", appVersion='" + appVersion + "'" + | ||
| ", baseURL='" + baseURL + "'" + | ||
| ", maxPinFailures='" + maxPinFailures + "'" + | ||
| ", resourceBaseURL='" + resourceBaseURL + "'" + | ||
| ", keyStoreHash='" + getKeyStoreHash() + "'" + | ||
| ", serverPublicKey='" + serverPublicKey + "'" + | ||
| "}"; | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
...le/android/app/src/main/kotlin/com/onegini/mobile/onegini_example/SecurityController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.onegini.mobile.onegini_example; | ||
|
|
||
| @SuppressWarnings({ "unused", "WeakerAccess" }) | ||
| public final class SecurityController { | ||
| public static final boolean rootDetection = false; | ||
| public static final boolean debugDetection = false; | ||
| public static final boolean debugLogs = true; | ||
| } | ||
7 changes: 0 additions & 7 deletions
7
example/android/app/src/main/kotlin/com/onegini/mobile/onegini_example/SecurityController.kt
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,62 +1,62 @@ | ||
| buildscript { | ||
| ext.kotlin_version = '1.8.0' | ||
| repositories { | ||
| mavenCentral() | ||
| google() | ||
| } | ||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:7.2.2' | ||
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
| } | ||
| } | ||
| allprojects { | ||
| repositories { | ||
| google() | ||
| def (artifactoryUser, artifactoryPassword) = getArtifactoryCredentials() | ||
| if (artifactoryUser?.trim() && artifactoryPassword?.trim()) { | ||
| maven { | ||
| url "https://repo.onewelcome.com/artifactory/onegini-sdk" | ||
| credentials { | ||
| username artifactoryUser.trim() | ||
| password artifactoryPassword.trim() | ||
| } | ||
| } | ||
| } else { | ||
| throw new InvalidUserDataException("You must configure the 'ARTIFACTORY_USER' and 'ARTIFACTORY_PASSWORD' environment variables before you can " + | ||
| "build the project.") | ||
| } | ||
| } | ||
| } | ||
| rootProject.buildDir = '../build' | ||
| subprojects { | ||
| project.buildDir = "${rootProject.buildDir}/${project.name}" | ||
| } | ||
| subprojects { | ||
| project.evaluationDependsOn(':app') | ||
| } | ||
| task clean(type: Delete) { | ||
| delete rootProject.buildDir | ||
| } | ||
| def getArtifactoryCredentials() { | ||
| // Leave onegini_ property for backwards compatibility | ||
| if (project.hasProperty('onegini_artifactory_user') && project.hasProperty('onegini_artifactory_password')) { | ||
| return [onegini_artifactory_user, onegini_artifactory_password] | ||
| } else if (project.hasProperty('artifactory_user') && project.hasProperty('artifactory_password')) { | ||
| return [artifactory_user, artifactory_password] | ||
| } else if (System.env.ARTIFACTORY_USER && System.env.ARTIFACTORY_PASSWORD) { | ||
| return [System.env.ARTIFACTORY_USER, System.env.ARTIFACTORY_PASSWORD] | ||
| } else { | ||
| def artifactoryFile = file("${project.rootDir}/artifactory.properties") | ||
| if (artifactoryFile.exists()) { | ||
| def props = new Properties() | ||
| artifactoryFile.withInputStream { props.load(it) } | ||
| return [props.getProperty("artifactoryUser"), props.getProperty("artifactoryPassword")] | ||
| } | ||
| } | ||
| return ["", ""] | ||
| } | ||
| buildscript { | ||
| ext.kotlin_version = '1.8.0' | ||
| repositories { | ||
| mavenCentral() | ||
| google() | ||
| } | ||
|
|
||
| dependencies { | ||
| classpath 'com.android.tools.build:gradle:7.2.2' | ||
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
| } | ||
| } | ||
|
|
||
| allprojects { | ||
| repositories { | ||
| google() | ||
| def (artifactoryUser, artifactoryPassword) = getArtifactoryCredentials() | ||
| if (artifactoryUser?.trim() && artifactoryPassword?.trim()) { | ||
| maven { | ||
| url "https://repo.onewelcome.com/artifactory/onegini-sdk" | ||
| credentials { | ||
| username artifactoryUser.trim() | ||
| password artifactoryPassword.trim() | ||
| } | ||
| } | ||
| } else { | ||
| throw new InvalidUserDataException("You must configure the 'ARTIFACTORY_USER' and 'ARTIFACTORY_PASSWORD' environment variables before you can " + | ||
| "build the project.") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| rootProject.buildDir = '../build' | ||
| subprojects { | ||
| project.buildDir = "${rootProject.buildDir}/${project.name}" | ||
| } | ||
| subprojects { | ||
| project.evaluationDependsOn(':app') | ||
| } | ||
|
|
||
| tasks.register("clean", Delete) { | ||
| delete rootProject.buildDir | ||
| } | ||
|
|
||
| def getArtifactoryCredentials() { | ||
| // Leave onegini_ property for backwards compatibility | ||
| if (project.hasProperty('onegini_artifactory_user') && project.hasProperty('onegini_artifactory_password')) { | ||
| return [onegini_artifactory_user, onegini_artifactory_password] | ||
| } else if (project.hasProperty('artifactory_user') && project.hasProperty('artifactory_password')) { | ||
| return [artifactory_user, artifactory_password] | ||
| } else if (System.env.ARTIFACTORY_USER && System.env.ARTIFACTORY_PASSWORD) { | ||
| return [System.env.ARTIFACTORY_USER, System.env.ARTIFACTORY_PASSWORD] | ||
| } else { | ||
| def artifactoryFile = file("${project.rootDir}/artifactory.properties") | ||
| if (artifactoryFile.exists()) { | ||
| def props = new Properties() | ||
| artifactoryFile.withInputStream { props.load(it) } | ||
| return [props.getProperty("artifactoryUser"), props.getProperty("artifactoryPassword")] | ||
| } | ||
| } | ||
| return ["", ""] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also add
public static final boolean debugLogs = true;if we want to make devs life easier. We do that in our example app https://github.com/onewelcome/example-app-android/blob/master/app/src/main/java/com/onegini/mobile/exampleapp/SecurityController.java