This a federated authenticator for WSO2 Identity Server which can be used in UAE Pass IdP. The entire federated authentication process can be denoted as just using 03 steps as follows.
Bellow sequence diagram will eloborate how the request flow is going to happen with above created cutom federated authenticator. Any one can test this flow using browser's inspect to attached HAR file here
Fork the repo on GitHub.
Clone the project to your own machine.
git clone https://github.com/<YOUR_USERNAME>/wso2-IS-UAEPass-authenticator.git
Create a branch using the git checkout command.
git checkout -b <your-new-branch-name>`
Stage your changes and commit with a meaningful commit message.
git add .
git commit -m "<initial commit>"
Push your work back up to your fork.
git push origin <add-your-branch-name>
mvn install
<PROJECT HOME>/target
.org.wso2.carbon.identity.uae.pass.federated.authenticator-<VERSION>
Refer the UAEPassFederatedAuthenticatorServiceComponent
class as well since the authenticator is written as OSGI service to deploy in the WSO2 Identity Server and register it as UAEPass Federated Authenticator.
The UAEPassAuthenticator
should be written by extending the AbstractApplicationAuthenticator
class and implementing the FederatedApplicationAuthenticator interface.
Class name | Super class | Interface |
---|---|---|
UAEPassAuthenticator | AbstractApplicationAuthenticator | FederatedApplicationAuthenticator |
boolean canHandle(HttpServletRequest request) |
Return | Parameter |
---|---|---|
Boolean | HttpServletRequest |
Specifies whether this authenticator can handle the authentication response.
This is the name which is going to appear as the display name of the custom federated authenticator. It will appear as UAEPass Federated Authenticator Configuration
in WSO2 IS, Identity Providers
→ Local and Outbound Authenticators
→ Federated Authentication
→ Custom Federated Authenticators
.
This name is going to appear as an unique identifier of the component. Once you spin up WSO2 IS, then open inspect elements. Now navigate to the federated authenticator’s custom user input fields. Then you may be able to see how the name and id of those input fields are listed as. Always starting as UAEPassFederatedAuthenticator
.
As usually it shows the claim dialect. Also can be configured as a custom user input field.
List Property getConfigurationProperties()
List down all the custom user input fields of the federated authenticator. Those user inputs hold the values as key value pairs. Therefore having a HashMap is a must especially in this case. But within this method it is not going to take those values that the user already input. Just take the constant values which were set.
Return | Parameter |
---|---|
HttpServletRequest | |
List |
HttpServletResponse |
AuthenticationContext |
Redirects the user to the login page in order to authenticate. In this UAE Pass Authenticator plugin, the user is redirected to the login page of the application which is configured in the UAEPass side which acts as the external Identity Provider. Within this method, it's going to fetch out the exact data inserted in above user input fields in UAEPass Federated Authenticator.
Once those user input fields are fetched, using Java builder design pattern the authorization request is going to be created. authzRequest
.
Once an authorization request is created, it will be sent to the login screen while embedding a sessionDataKey. Here still no authorization code is created.