summaryrefslogtreecommitdiff
path: root/nexus/src/main
diff options
context:
space:
mode:
authorMarcello Stanisci <ms@taler.net>2020-05-12 18:55:31 +0200
committerMarcello Stanisci <ms@taler.net>2020-05-12 18:55:31 +0200
commit545ebacc71734b3b6f9a491f7cddf1450fbda5fd (patch)
tree511e61d1033c86b4e1a35a1423c4dacd79581b60 /nexus/src/main
parentb2310a690564857eb7a1b86bbff6033c103eb603 (diff)
downloadlibeufin-545ebacc71734b3b6f9a491f7cddf1450fbda5fd.tar.gz
libeufin-545ebacc71734b3b6f9a491f7cddf1450fbda5fd.tar.bz2
libeufin-545ebacc71734b3b6f9a491f7cddf1450fbda5fd.zip
integration test
Admin gets password accepted.
Diffstat (limited to 'nexus/src/main')
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
index 4258b844..93e5eb94 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/Helpers.kt
@@ -423,13 +423,15 @@ fun extractNexusUser(param: String?): NexusUserEntity {
* will then be compared with the one kept into the database.
*/
fun extractUserAndHashedPassword(authorizationHeader: String): Pair<String, ByteArray> {
+ logger.debug("Authenticating: $authorizationHeader")
val (username, password) = try {
val split = authorizationHeader.split(" ")
- val valueUtf8 = String(base64ToBytes(split[1]), Charsets.UTF_8) // newline introduced here: BUG!
- valueUtf8.split(":")
+ val plainUserAndPass = String(base64ToBytes(split[1]), Charsets.UTF_8)
+ plainUserAndPass.split(":")
} catch (e: java.lang.Exception) {
throw NexusError(
- HttpStatusCode.BadRequest, "invalid Authorization:-header received"
+ HttpStatusCode.BadRequest,
+ "invalid Authorization:-header received"
)
}
return Pair(username, CryptoUtil.hashStringSHA256(password))