Skip to content

Commit

Permalink
SDKS-3595 Remove Deprecated Sample Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
witrisna committed Nov 20, 2024
1 parent 7cfb7cd commit e46c9a7
Show file tree
Hide file tree
Showing 361 changed files with 223 additions and 8,307 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bitbar-prepare-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Sign app-debug-androidTest.apk
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: samples/app/build/outputs/apk/androidTest/debug
releaseDirectory: e2e/app/build/outputs/apk/androidTest/debug
signingKeyBase64: ${{ secrets.SIGNING_KEYSTORE }}
alias: ${{ secrets.SIGNING_ALIAS }}
keyStorePassword: ${{ secrets.SIGNING_KEYSTORE_PASSWORD }}
Expand All @@ -76,7 +76,7 @@ jobs:
if: success()
with:
name: app-debug-androidTest-signed.apk
path: samples/app/build/outputs/apk/androidTest/debug/app-debug-androidTest-signed.apk
path: e2e/app/build/outputs/apk/androidTest/debug/app-debug-androidTest-signed.apk

- name: Publish forgerock-integration-tests-debug-androidTest-signed.apk
uses: actions/upload-artifact@v3
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
213 changes: 213 additions & 0 deletions e2e/app/src/main/java/com/example/app/env/EnvViewModel.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
/*
* Copyright (c) 2023 - 2024 ForgeRock. All rights reserved.
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

package com.example.app.env

import android.content.Context
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.app.storage.loadCookiesStorage
import com.example.app.storage.loadSSOTokenStorage
import com.example.app.storage.loadTokenStorage
import kotlinx.coroutines.launch
import org.forgerock.android.auth.ContextProvider
import org.forgerock.android.auth.FRAuth
import org.forgerock.android.auth.FROptions
import org.forgerock.android.auth.FROptionsBuilder

const val USER_PROFILE_JOURNEY = "UserProfile"

class EnvViewModel : ViewModel() {

val servers = mutableListOf<FROptions>()

val localhost = FROptionsBuilder.build {
server {
url = "https://andy.petrov.ca/openam"
realm = "alpha"
cookieName = "c1c805de4c9b333"
timeout = 50
}
oauth {
oauthClientId = "c12743f9-08e8-4420-a624-71bbb08e9fe1"
oauthRedirectUri = "org.forgerock.demo://oauth2redirect"
oauthCacheSeconds = 0
oauthScope = "openid profile email address phone"
oauthThresholdSeconds = 0
oauthSignOutRedirectUri = "org.forgerock.demo://oauth2redirect"
}
service {
authServiceName = "protect"
}
}

val dbind = FROptionsBuilder.build {
server {
url = "http://192.168.86.32:8080/openam"
realm = "root"
cookieName = "iPlanetDirectoryPro"
timeout = 50
}
oauth {
oauthClientId = "AndroidTest"
//oauthRedirectUri = "org.forgerock.demo:/oauth2redirect"
oauthRedirectUri = "https://example.com/oauth2redirect"
oauthCacheSeconds = 0
oauthScope = "openid profile email address phone"
oauthThresholdSeconds = 0
}
service {
authServiceName = "sign-verifier-stoyan"
}
}

val sdk = FROptionsBuilder.build {
server {
url = "https://openam-dbind.forgeblocks.com/am"
realm = "alpha"
cookieName = "43d72fc37bdde8c"
timeout = 50
}
oauth {
oauthClientId = "AndroidTest"
oauthRedirectUri = "org.forgerock.demo:/oauth2redirect"
oauthCacheSeconds = 0
oauthScope = "openid profile email address phone"
oauthThresholdSeconds = 0
}
service {
authServiceName = "WebAuthn"
}
}

val local = FROptionsBuilder.build {
server {
url = "https://andy.petrov.ca/openam"
realm = "root"
cookieName = "iPlanetDirectoryPro"
timeout = 50
}
oauth {
oauthClientId = "AndroidTest"
oauthRedirectUri = "org.forgerock.demo:/oauth2redirect"
oauthCacheSeconds = 0
oauthScope = "openid profile email address phone"
oauthThresholdSeconds = 0
}
service {
authServiceName = "WebAuthn"
}
}

val ops = FROptionsBuilder.build {
server {
url = "https://default.forgeops.petrov.ca/am"
realm = "root"
cookieName = "iPlanetDirectoryPro"
timeout = 50
}
oauth {
oauthClientId = "AndroidTest"
oauthRedirectUri = "org.forgerock.demo:/oauth2redirect"
oauthCacheSeconds = 60
oauthScope = "openid profile email address phone"
oauthThresholdSeconds = 0
}
service {
authServiceName = "WebAuthn"
}
}

val forgeblock = FROptionsBuilder.build {
server {
url = "https://openam-sdks.forgeblocks.com/am"
realm = "alpha"
cookieName = "5421aeddf91aa20"
timeout = 50
}
oauth {
oauthClientId = "AndroidTest"
oauthRedirectUri = "org.forgerock.demo:/oauth2redirect"
//oauthRedirectUri = "https://idc.petrov.ca/oauth2redirect"
oauthCacheSeconds = 0
oauthScope = "openid profile email address phone fr:idm:*"
oauthThresholdSeconds = 0
}
service {
authServiceName = "WebAuthn"
}
/*
store {
//Default use SecureSharedPreferences
//oidcStorage = TokenStorage(ContextProvider.context)
//ssoTokenStorage = SSOTokenStorage(ContextProvider.context)
//cookiesStorage = CookiesStorage(ContextProvider.context)
oidcStorage = loadTokenStorage(ContextProvider.context)
ssoTokenStorage = loadSSOTokenStorage(ContextProvider.context)
cookiesStorage = loadCookiesStorage(ContextProvider.context)
}
*/
}

val pingOidc = FROptionsBuilder.build {
server {
url = "https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as"
}
oauth {
oauthClientId = "2dde00e2-3dd5-42b1-96e9-ad17e29f4bbd"
oauthRedirectUri = "org.forgerock.demo://oauth2redirect"
oauthScope = "openid email address phone profile revoke"
//oauthSignOutRedirectUri = "org.forgerock.demo://oauth2redirect"
}
}

var current by mutableStateOf(dbind)
private set

init {
servers.add(localhost)
servers.add(dbind)
servers.add(sdk)
servers.add(local)
servers.add(ops)
servers.add(forgeblock)
servers.add(pingOidc)
}

fun select(context: Context, options: FROptions) {
if(options.server.url.contains("pingone")) {
viewModelScope.launch {
val option =
options.discover(options.server.url + "/.well-known/openid-configuration")
FRAuth.start(context, option)
}
}
else {
FRAuth.start(context, options)
}
current = options
}

fun select(context: Context, host: String) {
servers.find {
it.server.url == host
}?.let {
select(context, it)
} ?: run {
select(context, dbind)
}
}

fun getAll(): List<FROptions> {
return servers
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions forgerock-auth-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ android {
}
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
Expand Down
139 changes: 0 additions & 139 deletions samples/app/src/main/java/com/example/app/env/EnvViewModel.kt

This file was deleted.

1 change: 0 additions & 1 deletion samples/auth/.gitignore

This file was deleted.

Loading

0 comments on commit e46c9a7

Please sign in to comment.