aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-02-03 17:00:55 +0100
committerRobert Jaros <rjaros@finn.pl>2019-02-03 17:00:55 +0100
commit3cc747afb298d297f0bc3680a561ea9f9075114e (patch)
tree5259450b3fc8864cefccc360a82251cfea6db8b6 /kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft
parent48d0bddd8f27c7165f7dfce3abe1072b6eb4f9f1 (diff)
downloadkvision-3cc747afb298d297f0bc3680a561ea9f9075114e.tar.gz
kvision-3cc747afb298d297f0bc3680a561ea9f9075114e.tar.bz2
kvision-3cc747afb298d297f0bc3680a561ea9f9075114e.zip
Refactor server-side interfaces.
Diffstat (limited to 'kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft')
-rw-r--r--kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/Security.kt10
1 files changed, 5 insertions, 5 deletions
diff --git a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/Security.kt b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/Security.kt
index b485e17d..e96744a9 100644
--- a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/Security.kt
+++ b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/Security.kt
@@ -37,18 +37,18 @@ class SecurityException(message: String) : Exception(message)
data class Credentials(val username: String? = null, val password: String? = null)
/**
- * Pac4j form login dispatcher.
+ * Form login dispatcher.
*/
-class LoginService {
+class LoginService(val loginEndpoint: String) {
val loginAgent = CallAgent()
/**
- * Login with Pac4j FormClient.
+ * Login with a form.
* @param credentials username and password credentials
*/
suspend fun login(credentials: Credentials?): Boolean =
if (credentials?.username != null) {
- loginAgent.remoteCall("callback?client_name=FormClient", obj {
+ loginAgent.remoteCall(loginEndpoint, obj {
this.username = credentials.username
this.password = credentials.password
}, HttpMethod.POST, "application/x-www-form-urlencoded").then { _: dynamic -> true }.asDeferred().await()
@@ -58,7 +58,7 @@ class LoginService {
}
/**
- * Pac4j form login dispatcher.
+ * Form login dispatcher.
*/
abstract class SecurityMgr {