From 42807c9c124621a9c6f4fb193f216656d38993f1 Mon Sep 17 00:00:00 2001 From: ossdhaval <343411+ossdhaval@users.noreply.github.com> Date: Wed, 10 Apr 2024 23:34:34 +0530 Subject: [PATCH] docs: refactor and proofread Signed-off-by: ossdhaval <343411+ossdhaval@users.noreply.github.com> --- .../scripts/person-authentication.md | 178 +++++++++++++----- mkdocs.yml | 6 +- 2 files changed, 138 insertions(+), 46 deletions(-) diff --git a/docs/admin/developer/scripts/person-authentication.md b/docs/admin/developer/scripts/person-authentication.md index a2752c19743..f8c5be99f62 100644 --- a/docs/admin/developer/scripts/person-authentication.md +++ b/docs/admin/developer/scripts/person-authentication.md @@ -11,44 +11,76 @@ tags: --- -## Person Authentication scripts -The Jans-Auth Server leverages interception scripts of [PersonAuthenticationType](https://github.com/JanssenProject/jans/blob/main/jans-core/script/src/main/java/io/jans/model/custom/script/type/auth/PersonAuthenticationType.java) which when implemented can facilitate complex multi-step, multi-factor authentication workflows. +# Person Authentication scripts -The authentication flow in the Jans Server is driven by the openID spec. The authorization request to the OP (Jans server) contains an optional query parameter called `acr_values` which is used by the OP to pick an interception script which will be run when `/authorize` endpoint (Authentication flow) is invoked. +The Janssen Server leverages interception scripts of +[PersonAuthenticationType](https://github.com/JanssenProject/jans/blob/main/jans-core/script/src/main/java/io/jans/model/custom/script/type/auth/PersonAuthenticationType.java) which when implemented can facilitate complex +multi-step, multi-factor authentication workflows. -Each authentication method, whose name is the `acr` value, is tied to a `PersonAuthenticationType` script which offers the authentication workflow. +The authentication flow in the Janssen Server is driven by the +[OpenID Connect specification](https://openid.net/specs/openid-connect-core-1_0.html). +The authorization request to the OP (the Janssen Server) contains an +optional query parameter called `acr_values` which is used by the OP to pick an +interception script which will be run when `/authorize` endpoint +(Authentication flow) is invoked. + +Each authentication method, whose name is the `acr` value, +is tied to a `PersonAuthenticationType` script which offers the authentication +workflow. Typically, a `PersonAuthenticationType` script can be used to: - 1. introduce a new 2FA authentication mechanism - 2. customize multistep authentication - 3. offer Social logins - 4. proactively perform fraud detection and block a fraudulent user. -Authentication mechanisms offered by Jans can be confirmed by checking the Janssen OP configuration URL, `https:///.well-known/openid-configuration`, and finding the `acr_values_supported`. +- Introduce a new 2FA authentication mechanism +- Customize multi-step authentication +- Offer Social logins +- Proactively perform fraud detection and block a fraudulent user + +Authentication mechanisms offered by Jans can be confirmed by checking the +Janssen Server OP configuration URL: + +``` +https:///.well-known/openid-configuration +``` + +under the claim `acr_values_supported`. ## Building blocks of an authentication workflow -Jans-auth server comprises of a number of beans, configuration files and Facelets (JSF) views, packaged as a WAR module. That means custom scripts and custom pages (JSF facelets) can make use of business logic already encapsulated in the Weld managed beans. The following sections explain how authentication flow can be built using a custom script. +Jans-auth server comprises of a number of beans, configuration files and +Facelets (JSF) views, packaged as a WAR module. That means custom scripts and +custom pages (JSF facelets) can make use of business logic already encapsulated +in the Weld managed beans. + +The following sections explain how authentication +flow can be built using a custom script. ### A. Custom script -The **PersonAuthenticationType** script is described by a java interface whose methods should be overridden to implement an authentication workflow. -The [article](../scripts/person-authentication-interface) talks about these methods in detail and the psuedo code for each method. +The **PersonAuthenticationType** script is described by a java interface +whose methods should be overridden to implement an authentication workflow. +The [article](../scripts/person-authentication-interface) talks about these +methods in detail and the psuedo code +for each method. ### B. UI pages: -All web pages are **xhtml** files. The Command-Action offering by JSF framework is used by the Jans-auth server to implement authentication flows. +All web pages are **xhtml** files. The Command-Action offering by JSF +framework is used by the Jans-auth server to implement authentication flows. #### a. Server-side actions implemented by custom script: -The custom script's `authenticate` and `prepareForStep` implementations are called by the following java class - [Authenticator](https://github.com/JanssenProject/jans/blob/main/jans-auth-server/server/src/main/java/io/jans/as/server/auth/Authenticator.java). These methods are mapped as command actions and view actions respectively in the web page. +The custom script's `authenticate` and `prepareForStep` implementations are +called by the following java class - [Authenticator](https://github.com/JanssenProject/jans/blob/main/jans-auth-server/server/src/main/java/io/jans/as/server/auth/Authenticator.java). These methods are +mapped as command actions and view actions respectively in the web page. Relevant methods: -|Signature|Description| -|-|-| -|boolean authenticate()|Makes the authentication flow proceed by calling the `authenticate` method of the custom script| -|String prepareAuthenticationForStep()|Makes the authentication flow proceed by calling the `prepareForStep` method of the custom script| +| Signature | Description | +|---------------------------------------|---------------------------------------------------------------------------------------------------| +| boolean authenticate() | Makes the authentication flow proceed by calling the `authenticate` method of the custom script | +| String prepareAuthenticationForStep() | Makes the authentication flow proceed by calling the `prepareForStep` method of the custom script | #### b. Web page in xhtml: -1. The `f:metadata` and `f:viewAction` tags are used to load variables (prepared in the `prepareForStep` method of the custom script). These variables are rendered on the UI page. +1. The `f:metadata` and `f:viewAction` tags are used to load variables +(prepared in the `prepareForStep` method of the custom script). These +variables are rendered on the UI page. ```