From 5b70a8f99747058790083b9ee2e481f93169ec11 Mon Sep 17 00:00:00 2001 From: TanelOrumaa Date: Tue, 16 Nov 2021 21:30:58 +0200 Subject: [PATCH] MOB-42 Added log out button to backend, fixed issue with challenge for test app --- .../mobileauthapp/ResultFragment.kt | 2 +- .../com/example/testmobileapp/MainActivity.kt | 5 ++- .../config/ApplicationConfiguration.kt | 2 +- .../src/main/resources/static/css/main.css | 7 +++- .../main/resources/templates/signature.html | 37 ++++++++----------- 5 files changed, 26 insertions(+), 27 deletions(-) diff --git a/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/ResultFragment.kt b/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/ResultFragment.kt index 0f3d919..e658c72 100644 --- a/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/ResultFragment.kt +++ b/MobileAuthApp/app/src/main/java/com/tarkvaraprojekt/mobileauthapp/ResultFragment.kt @@ -67,7 +67,7 @@ class ResultFragment : Fragment() { requireActivity().finishAndRemoveTask() } } else { - Log.i("Log thingy success", result.toString()) + Log.i("POST request response", result.toString()) if (args.mobile) { createResponse(true, result.toString(), paramsModel.token) } else { diff --git a/TestMobileApp/app/src/main/java/com/example/testmobileapp/MainActivity.kt b/TestMobileApp/app/src/main/java/com/example/testmobileapp/MainActivity.kt index 73ad255..d317f18 100644 --- a/TestMobileApp/app/src/main/java/com/example/testmobileapp/MainActivity.kt +++ b/TestMobileApp/app/src/main/java/com/example/testmobileapp/MainActivity.kt @@ -65,7 +65,7 @@ class MainActivity : AppCompatActivity() { private fun getData() { // Enter the server endpoint address to here //val originUrl = "enter-base-url-here" - val originUrl = "https-origin-url-here" + val originUrl = "https://5d0c-85-253-195-195.ngrok.io" val url = "$originUrl/auth/challenge" Ion.getDefault(this).conscryptMiddleware.enable(false) Ion.with(applicationContext) @@ -74,7 +74,8 @@ class MainActivity : AppCompatActivity() { .setCallback { _, result -> try { // Get data from the result and call launchAuth method - val challenge = result.asJsonObject["nonce"].toString() + val challenge = result.asJsonObject["nonce"].toString().replace("\"", "") + Log.v("Challenge", challenge) launchAuth(challenge, originUrl, "/auth/authentication") } catch (e: Exception) { Log.i("GETrequest", "was unsuccessful") diff --git a/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/ApplicationConfiguration.kt b/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/ApplicationConfiguration.kt index abee1f8..ca49fdb 100644 --- a/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/ApplicationConfiguration.kt +++ b/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/ApplicationConfiguration.kt @@ -10,7 +10,7 @@ class ApplicationConfiguration { // Endpoint for authentication val AUTHENTICATION_ENDPOINT_URL = "/auth/authentication" // URL for application. Use ngrok for HTTPS (or a tool of your own choice) and put the HTTPS link here. - val WEBSITE_ORIGIN_URL = "https://2c2c-85-253-195-252.ngrok.io" + val WEBSITE_ORIGIN_URL = "https://5d0c-85-253-195-195.ngrok.io" } } \ No newline at end of file diff --git a/demoBackend/src/main/resources/static/css/main.css b/demoBackend/src/main/resources/static/css/main.css index 31f3ebe..1b6bc96 100644 --- a/demoBackend/src/main/resources/static/css/main.css +++ b/demoBackend/src/main/resources/static/css/main.css @@ -1,5 +1,10 @@ html { - font-size: 4vw; + font-size: 2vh; +} + +.navbar { + padding-left: 1rem; + padding-right: 1rem; } .cont { diff --git a/demoBackend/src/main/resources/templates/signature.html b/demoBackend/src/main/resources/templates/signature.html index 0c8ce1c..5c4bd12 100644 --- a/demoBackend/src/main/resources/templates/signature.html +++ b/demoBackend/src/main/resources/templates/signature.html @@ -3,38 +3,31 @@ Login - + - +
-

Congratulations! You have just authenticated yourself using your mobile phone and your ID-card. You can try to give a signature to a file now.

+

Congratulations! You have just authenticated yourself using your mobile phone and your ID-card. You can try to + give a signature to a file now.

This page is still WIP, signing a document feature will be implemented later.
-
-
- - -
+
+