Skip to content

Commit 4a6ad86

Browse files
authored
Merge pull request #9 from GluuFederation/agama-typekey-update-readme
docs(readme): updates to the readme
2 parents dc482e6 + ad93dc4 commit 4a6ad86

File tree

1 file changed

+134
-60
lines changed

1 file changed

+134
-60
lines changed

README.md

Lines changed: 134 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,84 @@
1-
# Agama Typekey
1+
# Agama Typekey
22

33
[![Contributors][contributors-shield]][contributors-url]
44
[![Forks][forks-shield]][forks-url]
55
[![Stargazers][stars-shield]][stars-url]
66
[![Issues][issues-shield]][issues-url]
77
[![Apache License][license-shield]][license-url]
88

9-
This project allows you to record behavioral keystroke data and use it as a second factor of authentication by leveraging the Typekey API. For more information you can check:
10-
* [Details](./details.md)
11-
* [SCAN Documentation](.)
12-
* [Dynamic Client Registration specification](https://www.rfc-editor.org/rfc/rfc7591#section-3.1)
9+
## About Agama-typekey
1310

14-
## Requirements
11+
This repo is home to the Gluu Agama-typekey project. This project allows you to
12+
Record behavioral keystroke data and use it as a second factor of authentication
13+
by leveraging the Typekey API.
1514

16-
* [agama-typekey](https://github.com/GluuFederation/agama-typekey)
17-
* A SCAN subscription. Please visit [Agama Lab](https://gluu.org/agama-lab) and sign up for a free SCAN subscription, which gives you 500 credits. Each successful Typekey API call costs 4 credits.
1815

19-
### Software Statement Assertion
2016

21-
In order to call the Typekey API, you will need an OAuth client. Once you have a SCAN subscription on Agama Lab, navigate to `Market` > `SCAN` and create an SSA with the software claim `typekey`. The Typekey flow will register its own client via DCR with the SSA you provide in the configuration.
2217

23-
## Supported IDPs
18+
## Where To Deploy
2419

25-
| IDP | Description |
26-
| :------------------------------ |:-----------------------------------------------|
27-
| Jans Auth Server |[Deployment instructions](./jans-deployment.md) |
28-
| Gluu Flex |[Deployment instructions](.) |
20+
The project can be deployed to any IAM server that runs an implementation of
21+
the [Agama Framework](https://docs.jans.io/head/agama/introduction/) like
22+
[Janssen Server](https://jans.io) and [Gluu Flex](https://gluu.org/flex/).
2923

3024

31-
## Flows
25+
## How To Deploy
3226

33-
| Qualified Name | Description |
34-
|:------------------------ |:------------------|
35-
| `org.gluu.agama.typekey` | Full Typekey flow |
27+
Different IAM servers may provide different methods and
28+
user interfaces from where an Agama project can be deployed on that server.
29+
The steps below show how the Agama-typekey project can be deployed on the
30+
[Janssen Server](https://jans.io).
3631

32+
Deployment of an Agama project involves three steps.
3733

38-
## Configuration
34+
- [Downloading the `.gama` package from the project repository](#download-the-project)
35+
- [Adding the `.gama` package to the IAM server](#add-the-project-to-the-server)
36+
- [Configure the project](#configure-the-project)
3937

40-
| Flow | Property | Value Description |
41-
| ------------------------ |:---------------:| :---------------------------:|
42-
| `org.gluu.agama.typekey` | keystoreName | Keystore Name (optional) |
43-
| `org.gluu.agama.typekey` | keystorePasword | Keystore Password (optional) |
44-
| `org.gluu.agama.typekey` | orgId | `org_id` claim from SSA |
45-
| `org.gluu.agama.typekey` | scan_ssa | SSA string from Agama Lab |
46-
| `org.gluu.agama.typekey` | authHost | Authorization Server |
47-
| `org.gluu.agama.typekey` | scanHost | SCAN server |
48-
| `org.gluu.agama.typekey` | phrases | Phrases dictionary |
4938

39+
#### Pre-Requisites
40+
41+
* SCAN subscription: Visit [Agama Lab](https://gluu.org/agama-lab)
42+
and sign up for a free SCAN subscription, which gives you 500 credits.
43+
Each successful Typekey API call costs 4 credits.ts.
44+
45+
46+
##### Software Statement Assertion
47+
48+
In order to call the Typekey API, you will need an OAuth client. Once you have
49+
a SCAN subscription on Agama Lab, navigate to `Market` > `SCAN` and create an
50+
SSA with the software claim `typekey`. The Typekey flow will register its own
51+
client via DCR with the SSA you provide in the configuration.
52+
53+
54+
### Download the Project
55+
56+
> [!TIP]
57+
> Skip this step if you use the Janssen Server TUI tool to
58+
> configure this project. The TUI tool enables the download and adding of this
59+
> project directly from the tool, as part of the `community projects` listing.
60+
61+
The project is bundled as
62+
[.gama package](https://docs.jans.io/head/agama/gama-format/).
63+
Visit the `Assets` section of the
64+
[Releases](https://github.com/GluuFederation/agama-typekey/releases) to download
65+
the `.gama` package.
66+
67+
### Add The Project To The Server
68+
69+
The Janssen Server provides multiple ways an Agama project can be
70+
deployed and configured. Either use the command-line tool, REST API, or a
71+
TUI (text-based UI). Refer to
72+
[Agama project configuration page](https://docs.jans.io/head/admin/config-guide/auth-server-config/agama-project-configuration/) in the Janssen Server documentation for more details.
73+
74+
### Configure The Project
75+
76+
The Agama project accepts configuration parameters in the JSON format. Every Agama
77+
project comes with a basic sample configuration file for reference.
78+
79+
Below is a typical configuration of the Agama-typekey project. As shown, it contains
80+
configuration parameters for the [flows contained in it](#flows-in-the-project):
5081

51-
## Sample JSON
5282
```json
5383
{
5484
"org.gluu.agama.typekey": {
@@ -65,64 +95,108 @@ In order to call the Typekey API, you will need an OAuth client. Once you have a
6595
}
6696
}
6797
```
98+
Check the flow detail section for details about configuration parameters.
6899

69-
### Configuration details
70100

71-
- `keystoreName` and `keystorePassword` are optional, in case you want to include a signature when sending the Typekey data. Leave them as blank otherwise.
72-
- `orgId` is the organization ID that can be obtained by decoding the software statement JWT and looking at the `org_id` claim (You may use `https://jwt.io` to decode the SSA).
73-
- `scan_ssa` is the JWT string you obtain from Agama Lab
74-
- `authHost` and `scanHost` can be left as is
75-
- `phrases` is a dictionary of strings from which the phrase used for behavioral metrics is selected. The dictionary pairs must be in format `string:string` where keys are unique numbers in string format and values are unique phrases.
101+
### Test The Flow
76102

77-
## Details
103+
Use any relying party implementation (like [jans-tarp](https://github.com/JanssenProject/jans/tree/main/demos/jans-tarp))
104+
to send an authentication request that triggers the flow.
78105

79-
The first time a user starts the Typekey flow, Typekey will choose a random phrase from the `phrases` dict in the configuration and store it in persistence. Then, the Typekey API is called to provide the keystroke data recorded during the flow. The first 5 times, Typekey API will train on the data provided. This phase is called "Enrollment". On the 6th attempt onward, Typekey API will validate the provided keystroke data using the training data stored during enrollment. If the behavioral data is sufficiently different from the trained data, Typekey API will deny the request.
106+
From the incoming authentication request, the Janssen Server reads the `ACR`
107+
parameter value to identify which authentication method should be used.
108+
To invoke the `org.gluu.agama.typekey` flow contained in the Agama-typekey project,
109+
specify the ACR value as `agama_<qualified-name-of-the-top-level-flow>`,
110+
i.e `agama_org.gluu.agama.typekey`.
80111

81-
In case Typekey API denies the request, Agama Typekey falls back to password authentication, and retrains the API on the provided data.
82112

83-
## Demo
113+
## Customize and Make It Your Own
84114

85-
Enrollment:
115+
Fork this repo to start customizing the Agama-PW project. It is possible to
116+
customize the user interface provided by the flow to suit your organization's
117+
branding
118+
guidelines. Or customize the overall flow behavior. Follow the best
119+
practices and steps listed
120+
[here](https://docs.jans.io/head/admin/developer/agama/agama-best-practices/#project-reuse-and-customizations)
121+
to achieve these customizations in the best possible way.
122+
This project can be reused in other Agama projects to create more complex
123+
authentication journeys. To re-use, trigger the [org.gluu.agama.typekey](#orggluuagamatypekey)
124+
flow from other Agama projects.
86125

126+
To make it easier to visualize and customize the Agama Project, use
127+
[Agama Lab](https://cloud.gluu.org/agama-lab/login).
87128

88-
https://github.com/SafinWasi/agama-typekey/assets/6601566/2256877b-3b49-48d8-b292-3d9da4a3a4c5
89129

130+
## Flows In The Project
90131

132+
List of the flows:
91133

92-
Typekey API approval:
134+
- [org.gluu.agama.typekey](#orggluuagamatypekey)
93135

94136

137+
### org.gluu.agama.typekey
95138

96-
https://github.com/SafinWasi/agama-typekey/assets/6601566/de5dcb19-9fbb-41f3-b897-606fc52fce85
139+
The first time a user starts the Typekey flow, Typekey will choose a random
140+
phrase from the `phrases` dict in the configuration and store it in persistence.
141+
Then, the Typekey API is called to provide the keystroke data recorded during
142+
the flow. The first 5 times, the Typekey API will train on the data provided.
143+
This phase is called "Enrollment". On the 6th attempt onward, Typekey API will
144+
validate the provided keystroke data using the training data stored during
145+
enrollment. If the behavioral data is sufficiently different from the trained
146+
data, Typekey API will deny the request.
97147

148+
In case the Typekey API denies the request, Agama Typekey falls back to password authentication, and retrains the API on the provided data.
98149

99150

151+
#### Parameter Details
100152

101-
Typekey API denied, fallback to password:
102153

154+
| Name | Description | Notes |
155+
| ----------------- | --------------------------------------------------------------------- | --------------------------------------- |
156+
| `keystoreName` | Optional name for the keystore if you want to include a signature when sending Typekey data. | Leave blank if not needed.|
157+
| `keystorePassword` | Optional password for the keystore for signature inclusion. | Leave blank if not needed.|
158+
| `orgId` | Organization ID obtained by decoding the software statement JWT.| Look for the org_id claim; use https://jwt.io to decode.|
159+
| `scan_ssa` | JWT string obtained from Agama Lab.| |
160+
| `authHost` | Host URL for authentication. | Can be left as is.|
161+
| `scanHost` | Host URL for scanning. | Can be left as is.|
162+
| `phrases` | Dictionary of strings for selecting phrases used in behavioral metrics. | Use format string:string with unique keys and values.|
103163

104164

105-
https://github.com/SafinWasi/agama-typekey/assets/6601566/b0288f5c-6a84-4ea0-b6a4-ac9052409189
165+
166+
## Demo
106167

107168

169+
Check out this video to see the **agama-typekey** authentication flow in action.
170+
Also check the
171+
[Agama Project Of The Week](https://gluu.org/agama-project-of-the-week/) video
172+
series for a quick demo on this flow.
108173

109-
# Contributors
174+
*Note:*
175+
While the video shows how the flow works overall, it may be dated. Do check the
176+
[Test the Flow](#test-the-flow) section to understand the current
177+
method of passing the ACR parameter when invoking the flow.
110178

111-
<table>
112-
<tr>
113-
<td align="center" style="word-wrap: break-word; width: 150.0; height: 150.0">
114-
<a href=https://github.com/SafinWasi>
115-
<img src=https://avatars.githubusercontent.com/u/6601566?v=4 width="100;" style="border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt=SafinWasi/>
116-
<br />
117-
<sub style="font-size:14px"><b>SafinWasi</b></sub>
118-
</a>
119-
</td>
120-
</tr>
121-
</table>
179+
### Enrollment
180+
181+
https://github.com/SafinWasi/agama-typekey/assets/6601566/2256877b-3b49-48d8-b292-3d9da4a3a4c5
182+
183+
184+
185+
### Typekey API approval
186+
187+
188+
189+
https://github.com/SafinWasi/agama-typekey/assets/6601566/de5dcb19-9fbb-41f3-b897-606fc52fce85
190+
191+
192+
193+
194+
### Typekey API denied, fallback to password
195+
196+
197+
https://github.com/SafinWasi/agama-typekey/assets/6601566/b0288f5c-6a84-4ea0-b6a4-ac9052409189
122198

123-
# License
124199

125-
This project is licensed under the [Apache 2.0](./LICENSE)
126200

127201
<!-- This are stats url reference for this repository -->
128202

0 commit comments

Comments
 (0)