From bfdd9d0517585647b58b4a528f015a912f316f5f Mon Sep 17 00:00:00 2001 From: Hasanthi Dissanayake Date: Mon, 16 Oct 2023 11:12:30 +0530 Subject: [PATCH] Modify the AdditionalData object --- .../framework/model/AdditionalData.java | 74 +++++++++++++++++++ .../framework/model/AuthenticatorData.java | 11 +++ 2 files changed, 85 insertions(+) create mode 100644 components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AdditionalData.java diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AdditionalData.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AdditionalData.java new file mode 100644 index 000000000000..0302f938c5d6 --- /dev/null +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AdditionalData.java @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.identity.application.authentication.framework.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Holds the additional data related to an authenticator which requires to populate {@Code AuthenticatorData} + * during an authentication flow. This contains additional authentication data specific to authentication flow. + */ +public class AdditionalData { + + private String requiredParams; + private String redirectUrl; + private String promptType; + private Map additionalAuthenticationParams = new HashMap<>(); + + public String getRequiredParams() { + + return requiredParams; + } + + public void setRequiredParams(String requiredParams) { + + this.requiredParams = requiredParams; + } + + public String getRedirectUrl() { + + return redirectUrl; + } + + public void setRedirectUrl(String redirectUrl) { + + this.redirectUrl = redirectUrl; + } + + public String getPromptType() { + + return promptType; + } + + public void setPromptType(String promptType) { + + this.promptType = promptType; + } + + public Map getAdditionalAuthenticationParams() { + + return additionalAuthenticationParams; + } + + public void setAdditionalAuthenticationParams(Map additionalAuthenticationParams) { + + this.additionalAuthenticationParams = additionalAuthenticationParams; + } +} diff --git a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AuthenticatorData.java b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AuthenticatorData.java index ddb32f55ef5c..fa5edafd7544 100644 --- a/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AuthenticatorData.java +++ b/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org/wso2/carbon/identity/application/authentication/framework/model/AuthenticatorData.java @@ -35,6 +35,17 @@ public class AuthenticatorData { private String i18nKey; private List authParams = new ArrayList<>(); private Map additionalData = new HashMap<>(); + private AdditionalData additionalDataObj; + + public AdditionalData getAdditionalDataObj() { + + return additionalDataObj; + } + + public void setAdditionalData(AdditionalData additionalDataObj) { + + this.additionalDataObj = additionalDataObj; + } public String getI18nKey() {