Skip to content

Commit fb2a6f1

Browse files
authored
feat: update docs
feat: update docs
2 parents a292ded + 9fdc269 commit fb2a6f1

10 files changed

+1650
-859
lines changed

README.md

+69-42
Original file line numberDiff line numberDiff line change
@@ -15,70 +15,97 @@ When a main flow of this project is launched (namely `org.gluu.agama.passkey.mai
1515
redirected to a view where he/she must first enter your username and password, then show a list of passkeys that you have
1616
registered, in case you do not have one you must register one, once you have registered your passkey you can complete
1717
the authentication step with passkey.
18-
But you can also log in from the initial screen without entering a c redential.
18+
But you can also log in from the initial screen without entering a credential.
1919

2020
## Project Deployment
2121

2222
To deploy this project we need to meet the requirements.
2323

2424
### Requirements
2525

26-
1. Running instance of `Jans Auth Server`, `Jans Fido2`, `Jans Casa` and `Jans Scim`
26+
1. Running instance of
27+
- `Jans Auth Server`
28+
- `Jans Fido2`
29+
- `Jans Casa`
30+
- `Jans Scim`
2731

2832
### Add Java dependencies
2933

30-
1. Download
31-
latest [agama-passkey-custom.jar](https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey-custom.jar)
32-
from [Releases](https://github.com/GluuFederation/agama-passkey/releases)
33-
2. `scp` the jar file to `/opt/jans/jetty/jans-auth/custom/libs/` on Auth Server
34-
3. On Auth Server, edit `/opt/jans/jetty/jans-auth/webapps/jans-auth.xml` and
35-
add the jar file to the `<set name="extractClasspath">...</Set>` element. For example:
34+
1. cd /opt/jans/jetty/jans-auth/custom/libs
35+
2. wget https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey-custom.jar
36+
3. If you are not using *.jar, update extractClasspath in /opt/jans/jetty/jans-auth/webapps/jans-auth.xml
37+
4. Restart server
3638

37-
```
38-
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
39-
<Set name="contextPath">/jans-auth</Set>
40-
<Set name="war">
41-
<Property name="jetty.webapps" default="." />/jans-auth.war
42-
</Set>
43-
<Set name="extractWAR">true</Set>
44-
<Set name="extraClasspath">
45-
...
46-
/opt/jans/jetty/jans-auth/custom/libs/agama-passkey-custom.jar,
47-
...
48-
</Set>
49-
</Configure>
50-
```
39+
### Deployment
5140

52-
4. Restart Auth Server to load the new jar:
41+
Run these instructions on the server where you have `Janssen` or `Gluu` installed:
5342

43+
- Download the
44+
latest [agama-passkey.gama](https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey.gama), you can use `wget`
45+
```shell
46+
wget https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey.gama
5447
```
55-
systemctl restart jans-auth
56-
````
5748

58-
### Deployment
49+
![TUI_AGAMA_DEPLOY](https://github.com/GluuFederation/agama-passkey/assets/86965029/1d6b8cab-ddad-451c-b620-d19be1b7f9e3)
5950

60-
Download the
61-
latest [agama-passkey.gama](https://github.com/GluuFederation/agama-passkey/releases/latest/download/agama-passkey.gama)
62-
file and deploy it in Auth Sever.
51+
### Configure Jans Scim
6352

64-
Follow the steps below:
53+
- Once we have deployed the `agama project`, we need to configure the `jans scim` parameters, then we proceed to create
54+
a new client `jans scim` with scope `https://jans.io/scim/fido2.read` and `https://jans.io/scim/fido2.write`.
6555

66-
- Copy (SCP/SFTP) the gama file of this project to a location in your `Jans Server`
67-
- Connect (SSH) to your `Jans Server` and open TUI: `python3 /opt/jans/jans-cli/jans_cli_tui.py`
68-
- Navigate to the `Agama` tab and then select `"Upload project"`. Choose the gama file
69-
- Wait for about one minute and then select the row in the table corresponding to this project
70-
- Press `d` and ensure there were not deployment errors
71-
- Pres `ESC` to close the dialog
56+
You can create the client using the registration web service.
7257

73-
![TUI_AGAMA_DEPLOY](https://github.com/GluuFederation/agama-passkey/assets/86965029/1d6b8cab-ddad-451c-b620-d19be1b7f9e3)
58+
**Request**
7459

75-
### Configure Jans Scim
60+
```
61+
curl --location 'https://<YOUR_DOMAIN>/jans-auth/restv1/register' \
62+
--header 'Content-Type: application/json' \
63+
--data '{
64+
"client_name": "SCIM Agama Client",
65+
"scope": [
66+
"https://jans.io/scim/fido2.read",
67+
"https://jans.io/scim/fido2.write"
68+
],
69+
"grant_types": [
70+
"client_credentials"
71+
],
72+
"token_endpoint_auth_method": "client_secret_basic"
73+
}'
74+
```
75+
76+
**Response**
77+
78+
```
79+
{
80+
"allow_spontaneous_scopes": false,
81+
"application_type": "web",
82+
"rpt_as_jwt": false,
83+
"registration_client_uri": "https://<YOUR_DOMAIN>/jans-auth/restv1/register?client_id=27975f1c-eee6-4bf8-b393-5fb47d44c566",
84+
"tls_client_auth_subject_dn": "",
85+
"run_introspection_script_before_jwt_creation": false,
86+
"registration_access_token": "<YOUR_REGISTRATION_ACCESS_TOKEN>",
87+
"client_id": "<YOUR_CLIENT_ID>",
88+
"client_secret": "<YOUR_SECRET_KEY>",
89+
"token_endpoint_auth_method": "client_secret_basic",
90+
"scope": "https://jans.io/scim/fido2.read https://jans.io/scim/fido2.write",
91+
"client_id_issued_at": 1710469308,
92+
"backchannel_logout_session_required": false,
93+
"client_name": "Scim custom client",
94+
"par_lifetime": 600,
95+
"spontaneous_scopes": [],
96+
"id_token_signed_response_alg": "RS256",
97+
...,
98+
...,
99+
...
100+
}
101+
```
76102

77-
- Once we have deployed the `agama project`, we need to configure the `jans scim` parameters, then we proceed to create a new user `jans scim` with scope `https://jans.io/scim/fido2.read` and `https://jans.io/scim/fido2.write`.
78-
- Now that we have the jans scim client, we proceed to configure this client using TUI.
79-
- We open TUI and we are located in agama, we select in the table where our application is deployed and press `c`, this will open a configuration panel, where we must first hit `Export Sample Config` and save the file in some path.
103+
- Now that we have the jans scim client, we proceed to configure this client using `TUI`.
104+
- We open `TUI` and we are located in agama, we select in the table where our application is deployed and press `c`, this
105+
will open a configuration panel, where we must first hit `Export Sample Config` and save the file in some path.
80106
- Now we go to the exported file and edit it and enter the credentials
81107

108+
82109
```
83110
{
84111
"org.gluu.agama.passkey.add": {},
@@ -101,7 +128,7 @@ Follow the steps below:
101128
You'll need an OpenID Connect test RP. You can try [oidcdebugger](https://oidcdebugger.com/),
102129
[jans-tarp](https://github.com/JanssenProject/jans/tree/main/demos/jans-tarp)
103130
or [jans-tent](https://github.com/JanssenProject/jans/tree/main/demos/jans-tent). Check out this video to see an example
104-
of **agama-passkey** in action:
131+
of **agama-passkey** in action:v
105132

106133
### Use case 1:
107134

code/org.gluu.agama.passkey.add.flow

+22-7
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,50 @@
1+
// Flow that takes care of registering a new Passkey
12
Flow org.gluu.agama.passkey.add
23
Basepath ""
34
Inputs userData
5+
// Set "inum" obtained from userData
46
inum = userData.inum
7+
// Get Instance FidoEnroller
58
fidoEnroller = Call org.gluu.agama.passkey.enroll.FidoEnroller#new
9+
// Declaration of the variable "obj" with initial data
610
obj = { attestation: "{}", isAttestation: false, showError: false, errorTitle: "", errorMessage: "" }
7-
Repeat 50 times max
11+
Repeat 5 times max
12+
// Load passkey-add.ftlh page
813
addDeviceForm = RRF "passkey-add.ftlh" obj
914
When addDeviceForm.addPasskeyBtn is ""
15+
// Invoke the method to initiate passkey registration
1016
detestable = Call fidoEnroller getAttestationMessage inum
17+
// Show registration flow
1118
obj.isAttestation = true
1219
obj.attestation = detestable
1320
obj.showError = false
1421
When addDeviceForm.skipped is "skipped"
22+
// Process cancellation error displayed
1523
obj.isAttestation = false
1624
obj.showError = true
1725
obj.errorTitle = "Passkey registration failed."
1826
obj.errorMessage = addDeviceForm.errorMessage
1927
When addDeviceForm.tokenResponse is not ""
28+
// Invoke method to verify passkey registration
2029
key | E = Call fidoEnroller verifyRegistration inum addDeviceForm.tokenResponse
2130
When E is null and key is not null
31+
// Flow to assign a nickname to the registered passkey
2232
nicknameTrigger = Trigger org.gluu.agama.passkey.nickname key userData
33+
// If there is an active registration flow, it will be canceled
2334
obj.isAttestation = false
24-
it_lyocp = {success:true, data: { userId: inum, response: nicknameTrigger }}
25-
Finish it_lyocp
35+
// Ends the flow by replying to the user's inum
36+
it_iqybp = {success:true, data: { userId: inum, response: nicknameTrigger }}
37+
Finish it_iqybp
2638
When E is not null
39+
// Show error with detail obtained from verify method
2740
obj.isAttestation = false
2841
obj.showError = true
2942
obj.errorTitle = "Passkey registration failed."
3043
obj.errorMessage = E.message
3144
When addDeviceForm.cancelBtn is ""
32-
it_bksml = {success:false, error: "Cancel event"}
33-
Finish it_bksml
34-
it_zodfn = {success:false, error: "Passkey registration attempt exceeded."}
35-
Finish it_zodfn
45+
// Ends the flow because the user cancels it
46+
it_chvmt = {success:false, error: "Cancel event"}
47+
Finish it_chvmt
48+
// Finish with error, because the limit of attempts was exceeded.
49+
it_vydgh = {success:false, error: "Passkey registration attempt exceeded."}
50+
Finish it_vydgh

0 commit comments

Comments
 (0)