mirror of
https://github.com/TanelOrumaa/Estonian-ID-card-mobile-authenticator-POC.git
synced 2024-12-22 04:20:16 +02:00
MOB-42 Added log out button to backend, fixed issue with challenge for test app
This commit is contained in:
parent
168c9be010
commit
5b70a8f997
@ -67,7 +67,7 @@ class ResultFragment : Fragment() {
|
|||||||
requireActivity().finishAndRemoveTask()
|
requireActivity().finishAndRemoveTask()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.i("Log thingy success", result.toString())
|
Log.i("POST request response", result.toString())
|
||||||
if (args.mobile) {
|
if (args.mobile) {
|
||||||
createResponse(true, result.toString(), paramsModel.token)
|
createResponse(true, result.toString(), paramsModel.token)
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,7 +65,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
private fun getData() {
|
private fun getData() {
|
||||||
// Enter the server endpoint address to here
|
// Enter the server endpoint address to here
|
||||||
//val originUrl = "enter-base-url-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"
|
val url = "$originUrl/auth/challenge"
|
||||||
Ion.getDefault(this).conscryptMiddleware.enable(false)
|
Ion.getDefault(this).conscryptMiddleware.enable(false)
|
||||||
Ion.with(applicationContext)
|
Ion.with(applicationContext)
|
||||||
@ -74,7 +74,8 @@ class MainActivity : AppCompatActivity() {
|
|||||||
.setCallback { _, result ->
|
.setCallback { _, result ->
|
||||||
try {
|
try {
|
||||||
// Get data from the result and call launchAuth method
|
// 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")
|
launchAuth(challenge, originUrl, "/auth/authentication")
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.i("GETrequest", "was unsuccessful")
|
Log.i("GETrequest", "was unsuccessful")
|
||||||
|
@ -10,7 +10,7 @@ class ApplicationConfiguration {
|
|||||||
// Endpoint for authentication
|
// Endpoint for authentication
|
||||||
val AUTHENTICATION_ENDPOINT_URL = "/auth/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.
|
// 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"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,5 +1,10 @@
|
|||||||
html {
|
html {
|
||||||
font-size: 4vw;
|
font-size: 2vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
padding-left: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cont {
|
.cont {
|
||||||
|
@ -3,38 +3,31 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Login</title>
|
<title>Login</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||||
|
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
|
||||||
<link th:href="@{/css/main.css}" rel="stylesheet">
|
<link th:href="@{/css/main.css}" rel="stylesheet">
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"
|
||||||
|
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p"
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
<script type="text/javascript" th:src="@{/js/signature.js}"></script>
|
<script type="text/javascript" th:src="@{/js/signature.js}"></script>
|
||||||
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
<script type="text/javascript" th:src="@{/js/main.js}"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<nav class="navbar navbar-dark bg-dark">
|
<nav class="navbar navbar-dark bg-dark">
|
||||||
<div class="container-fluid">
|
<a class="navbar-brand" href="#">Auth demo web application</a>
|
||||||
<a class="navbar-brand" href="#">Auth demo web application</a>
|
<ul class="navbar-nav mr-auto">
|
||||||
</div>
|
<li class="nav-item">
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<a href="/" class="btn btn-danger">Log out</a>
|
||||||
<span class="navbar-toggler-icon"></span>
|
</li>
|
||||||
</button>
|
</ul>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
|
||||||
<ul class="navbar-nav mr-auto">
|
|
||||||
<li class="nav-item active">
|
|
||||||
<a class="nav-link" href="#">Log out<span class="sr-only">(current)</span></a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</nav>
|
</nav>
|
||||||
<div class="cont">
|
<div class="cont">
|
||||||
<h4>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.</h4>
|
<h4>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.</h4>
|
||||||
<h5>This page is still WIP, signing a document feature will be implemented later.</h5>
|
<h5>This page is still WIP, signing a document feature will be implemented later.</h5>
|
||||||
<div class="input-group mb-3">
|
<div class="custom-file">
|
||||||
<div class="custom-file">
|
<input type="file" class="custom-file-input" id="customFile">
|
||||||
<input type="file" class="custom-file-input" id="inputGroupFile01">
|
|
||||||
<label class="custom-file-label" for="inputGroupFile01">Choose file</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-secondary" id="signFile" data-action="auth">Sign</button>
|
<button type="button" class="btn btn-secondary" id="signFile" data-action="auth">Sign</button>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user