Add empty ValidateActivity
This activity will handle the post-authorization portion of the debugger
This commit is contained in:
parent
fc5df943d8
commit
ddb99b7418
@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "com.shielddagger.auth.oidc_debugger"
|
||||
compileSdk = 34
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.shielddagger.auth.oidc_debugger"
|
||||
|
@ -14,6 +14,21 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.OIDCDebugger"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".ValidateActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/title_activity_validate"
|
||||
android:theme="@style/Theme.OIDCDebugger">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="oidcdebugger.shielddaggerhosted.com"
|
||||
android:pathPrefix="/redirect" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
@ -23,8 +38,17 @@
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<data
|
||||
android:scheme="https"
|
||||
android:host="oidcdebugger.shielddaggerhosted.com"
|
||||
android:pathPrefix="/home"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
|
||||
</manifest>
|
@ -0,0 +1,52 @@
|
||||
package com.shielddagger.auth.oidc_debugger
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import com.shielddagger.auth.oidc_debugger.ui.theme.OIDCDebuggerTheme
|
||||
|
||||
class ValidateActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val action = intent?.action
|
||||
val data = intent?.data
|
||||
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
OIDCDebuggerTheme {
|
||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||
Greeting2(
|
||||
data = data.toString(),
|
||||
action = action.toString(),
|
||||
modifier = Modifier.padding(innerPadding)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Greeting2(data: String, action: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
text = "$data\n$action",
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun GreetingPreview2() {
|
||||
OIDCDebuggerTheme {
|
||||
Greeting2("data", "action")
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.shielddagger.auth.oidc_debugger.oidc
|
||||
|
||||
import android.net.Uri
|
||||
import java.io.Serializable
|
||||
import java.util.ArrayList
|
||||
import kotlin.io.encoding.Base64
|
||||
import kotlin.io.encoding.ExperimentalEncodingApi
|
||||
@ -66,12 +67,13 @@ enum class OIDCAuthState(private val type: String) {
|
||||
|
||||
class OIDCCore(
|
||||
private val responseType: List<OIDCResponseType>,
|
||||
private val scope: List<String>,
|
||||
private val clientId: String,
|
||||
private val redirectUri: String,
|
||||
private val authorizeUri: String,
|
||||
private val tokenUri: String,
|
||||
private val clientSecret: String = "",
|
||||
val scope: List<String>,
|
||||
val clientId: String,
|
||||
val redirectUri: String,
|
||||
val authorizeUri: String,
|
||||
val tokenUri: String,
|
||||
val userinfoUri: String,
|
||||
val clientSecret: String = "",
|
||||
private val clientAuth: ClientAuthType = ClientAuthType.BASIC
|
||||
) {
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">OIDC Debugger</string>
|
||||
<string name="title_activity_validate">OIDC Debugger - Redirect</string>
|
||||
<string name="redirect_uri">https://oidcdebugger.shielddaggerhosted.com/redirect</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user