-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from SafinWasi/agama-lab-branch
Ok, let's see
- Loading branch information
Showing
5 changed files
with
125 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,49 @@ | ||
Flow org.gluu.agama.typekey | ||
Basepath "" | ||
Configs conf | ||
Basepath "" | ||
Configs conf | ||
idp = Call org.gluu.agama.typekey.IdentityProcessor#new | ||
tk = Call org.gluu.agama.typekey.Typekey#new conf | ||
user = RRF "typekey/username.ftlh" | ||
userData = Call idp accountFromUsername user.username | ||
When userData.empty is true | ||
it_vsrve = {success:false, error: "User not found"} | ||
Finish it_vsrve | ||
it_vsrve = {success:false, error: "User not found"} | ||
Finish it_vsrve | ||
Call tk dynamicRegistration conf.scan_ssa | ||
enrolled = Call idp enrolled user.username | ||
When enrolled is false | ||
random_usecase = Call tk getRandomUseCase | ||
phrase_map = Call tk generateTypekeyData random_usecase | ||
dummy = Call idp enroll user.username phrase_map | ||
phrase = phrase_map.phrase | ||
use_case = random_usecase | ||
random_usecase = Call tk getRandomUseCase | ||
phrase_map = Call tk generateTypekeyData random_usecase | ||
dummy = Call idp enroll user.username phrase_map | ||
phrase = phrase_map.phrase | ||
use_case = random_usecase | ||
When enrolled is true | ||
typekey_data = Call idp getTypekeyData user.username | ||
phrase = typekey_data.phrase | ||
use_case = typekey_data.useCase | ||
typekey_data = Call idp getTypekeyData user.username | ||
phrase = typekey_data.phrase | ||
use_case = typekey_data.useCase | ||
phraseDict = {phrase:phrase} | ||
phraseData = RRF "typekey/phrase.ftlh" phraseDict | ||
typekey_result = Call tk validateKeystrokes user.username phraseData.phrase_data use_case | ||
When typekey_result.status is "Enrollment" | ||
password = RRF "typekey/password.ftlh" | ||
authenticated = Call idp authenticate user.username password.pwd | ||
When authenticated is true | ||
Call tk notifyKeystrokes user.username typekey_result.track_id use_case | ||
it_spikk = {success:true, data: { userId: user.username}} | ||
Finish it_spikk | ||
it_ttqbc = {success:false, error: "Authentication failed"} | ||
Finish it_ttqbc | ||
Log "Agama Typekey: Enrollment in progress" | ||
password = RRF "typekey/password.ftlh" | ||
authenticated = Call idp authenticate user.username password.pwd | ||
When authenticated is true | ||
Call tk notifyKeystrokes user.username typekey_result.track_id use_case | ||
it_spikk = {success:true, data: { userId: user.username}} | ||
Finish it_spikk | ||
it_ttqbc = {success:false, error: "Authentication failed"} | ||
Finish it_ttqbc | ||
When typekey_result.status is "Approved" | ||
it_zirls = {success:true, data: { userId: user.username}} | ||
Finish it_zirls | ||
Log "Agama Typekey: Approved" | ||
it_zirls = {success:true, data: { userId: user.username}} | ||
Finish it_zirls | ||
password = RRF "typekey/password.ftlh" | ||
authenticated = Call idp authenticate user.username password.pwd | ||
When authenticated is true | ||
When typekey_result.status is "Denied" | ||
Call tk notifyKeystrokes user.username typekey_result.track_id use_case | ||
it_becry = {success:true, data: { userId: user.username }} | ||
Finish it_becry | ||
When typekey_result.status is "Denied" | ||
Log "Denied, fell back to password" | ||
Call tk notifyKeystrokes user.username typekey_result.track_id use_case | ||
it_becry = {success:true, data: { userId: user.username }} | ||
Finish it_becry | ||
it_ryekg = {success:false, error: "Typekey and password failed"} | ||
Finish it_ryekg | ||
Finish it_ryekg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
<#import "commons.ftlh" as com> | ||
<@com.main> | ||
<div class="border border-1 rounded p-5"> | ||
<form id="login_form" method="POST"> | ||
<div class="mb-3 row"> | ||
<div class="col-md-8"> | ||
<label for="username" class="col-md-4 col-form-label">Enter your username:</label> | ||
<input type="text" class="form-control" id="username" name="username"> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-12 d-flex justify-content-end"> | ||
<input type="submit" class="btn btn-success" id="login" value="Login"> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</@com.main> | ||
[#ftl output_format="HTML"] | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head></head> | ||
<body>[#import "commons.ftlh" as com] | ||
[@com.main] | ||
<div class="border border-1 rounded p-5"><form method="POST" id="login_form"><div class="mb-3 row"><div class="col-md-8"><label for="username" class="col-md-4 col-form-label">Enter your username:</label><input type="text" id="username" name="username" class="form-control"></div></div><div class="row"><div class="col-md-12 d-flex justify-content-end"><input type="submit" id="login" value="Login" class="btn btn-success"></div></div></form></div> | ||
[/@com.main]</body> | ||
|
||
|
||
</html> |